diff options
author | Guido van Rossum <guido@python.org> | 2016-10-22 00:30:29 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2016-10-22 00:30:29 (GMT) |
commit | 3b557991d4a7626cf12baf2277bc87acbc439744 (patch) | |
tree | 798b4eb2de1d4ae448d7250de518556e268c0012 /Lib/typing.py | |
parent | ac353dfa143e76fbac3f3d5dbb2104e21be8f127 (diff) | |
download | cpython-3b557991d4a7626cf12baf2277bc87acbc439744.zip cpython-3b557991d4a7626cf12baf2277bc87acbc439744.tar.gz cpython-3b557991d4a7626cf12baf2277bc87acbc439744.tar.bz2 |
Two minor typing.py fixes (upstream #305)
Diffstat (limited to 'Lib/typing.py')
-rw-r--r-- | Lib/typing.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/Lib/typing.py b/Lib/typing.py index 5761693..261da5d 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -894,7 +894,7 @@ def _replace_arg(arg, tvars, args): return arg._subs_repr(tvars, args) if isinstance(arg, TypeVar): for i, tvar in enumerate(tvars): - if arg.__name__ == tvar.__name__: + if arg == tvar: return args[i] return _type_repr(arg) @@ -1322,10 +1322,6 @@ if sys.version_info[:2] >= (3, 3): hints = obj.__annotations__ except AttributeError: return {} - # we keep only those annotations that can be accessed on module - members = obj.__dict__ - hints = {name: value for name, value in hints.items() - if name in members} for name, value in hints.items(): if value is None: value = type(None) |