diff options
author | Christian Tismer <tismer@stackless.com> | 2019-02-05 19:12:21 +0100 |
---|---|---|
committer | Christian Tismer <tismer@stackless.com> | 2019-02-06 13:36:31 +0000 |
commit | 44c46d25f63f986c53df35150a8953724d77f8b3 (patch) | |
tree | e4c0efa1fbc6120f6c96a819cb354c664929b876 /sources/shiboken2 | |
parent | b10d326b207186258605548c572166e717c8f1a6 (diff) |
Type Hints: Handle Container Types Correctly: Addendum
The correction to container types has a small bug which
does not exist in reality, but could give a problem in the
future:
- We need not only avoid instantiation in Missing, but
generally in all _NotCalled classes. Otherwise, when called
during processing of container types, they would loose
their (Missing, Default, ...whatever) tag.
Change-Id: I4eb154100da6f3067b816c190af314b2a710ff39
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken2')
-rw-r--r-- | sources/shiboken2/shibokenmodule/support/signature/parser.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sources/shiboken2/shibokenmodule/support/signature/parser.py b/sources/shiboken2/shibokenmodule/support/signature/parser.py index 3b09dd4f7..5c9a1e4f1 100644 --- a/sources/shiboken2/shibokenmodule/support/signature/parser.py +++ b/sources/shiboken2/shibokenmodule/support/signature/parser.py @@ -46,7 +46,7 @@ import types import keyword import functools from signature_loader.mapping import (type_map, update_mapping, namespace, - typing, Missing) + typing, _NotCalled) _DEBUG = False LIST_KEYWORDS = False @@ -218,7 +218,7 @@ def _resolve_type(thing, line): contr = to_string(_resolve_type(contr, line)) thing = to_string(_resolve_type(thing, line)) result = "{contr}[{thing}]".format(**locals()) - if not isinstance(thing, Missing): + if not isinstance(thing, _NotCalled): result = eval(result, namespace) return result return _resolve_value(thing, None, line) |