From 309c104aa38e16dbcdf1bf2f77f0613757e299fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Gr=C3=B6nholm?= Date: Sun, 11 Aug 2019 18:12:41 +0300 Subject: [PATCH] Added forward reference policies Fixes #70. --- CHANGELOG.rst | 1 + tests/test_typeguard.py | 33 ++++++++++++++++++++- typeguard/__init__.py | 65 +++++++++++++++++++++++++++++++++++++---- 3 files changed, 93 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 5897a5a9..99a594cd 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -10,6 +10,7 @@ This library adheres to `Semantic Versioning 2.0 None: # pragma: no cover func = None if func is not None and self.should_check_type(func): - memo = self._call_memos[frame] = _CallMemo(func, frame) + memo = self._call_memos[frame] = _CallMemo( + func, frame, forward_refs_policy=self.annotation_policy) if memo.is_generator: return_type_hint = memo.type_hints['return'] if return_type_hint is not None: