From 44c46d25f63f986c53df35150a8953724d77f8b3 Mon Sep 17 00:00:00 2001 From: Christian Tismer Date: Tue, 5 Feb 2019 19:12:21 +0100 Subject: 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 --- sources/shiboken2/shibokenmodule/support/signature/parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sources/shiboken2/shibokenmodule') 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) -- cgit v1.2.3