aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/typing27.py
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2019-02-15 18:39:45 +0100
committerChristian Tismer <tismer@stackless.com>2019-07-17 10:52:07 +0200
commit295d9d7fb52505666a6dc9ac7b6fba2323814c48 (patch)
tree4bd25ef6c9a49287f4a13e85c31cbc415c0a2d71 /sources/shiboken2/shibokenmodule/files.dir/shibokensupport/typing27.py
parent6c8fafb996e4cd2abd3dd82c3127c65b88157ff9 (diff)
Cleanup signature module before substantial change
There were some refinements applied while developing "Support Pointer Primitive Types by Arrays or Result Tuples". This patch moves these changes out which are not essential for that patch. They include - sort all mapping groups by name - replace huge regex by a pattern generator - replace dictionary string entries by SimpleNameSpace - improve PEP 563 handling - simplify "zero(sometype)" substantially - better handling of "QGenericMatrix" (preview) A test for the generated pattern against a reference parser was added. Task-number: PYSIDE-795 Task-number: PYSIDE-951 Change-Id: I5a6b236850c63a7db77b7f7b88881486fd1e61be Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken2/shibokenmodule/files.dir/shibokensupport/typing27.py')
-rw-r--r--sources/shiboken2/shibokenmodule/files.dir/shibokensupport/typing27.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/typing27.py b/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/typing27.py
index dba8f8c77..786a84ecb 100644
--- a/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/typing27.py
+++ b/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/typing27.py
@@ -1996,6 +1996,21 @@ class DefaultDict(collections.defaultdict, MutableMapping[KT, VT]):
return _generic_new(collections.defaultdict, cls, *args, **kwds)
+############################
+# Insertion by CT 2019-02-21
+#
+class OrderedDict(collections.OrderedDict, MutableMapping[KT, VT]):
+ __slots__ = ()
+ __extra__ = collections.OrderedDict
+
+ def __new__(cls, *args, **kwds):
+ if cls._gorg is OrderedDict:
+ return collections.OrderedDict(*args, **kwds)
+ return _generic_new(collections.OrderedDict, cls, *args, **kwds)
+#
+############################
+
+
class Counter(collections.Counter, Dict[T, int]):
__slots__ = ()
__extra__ = collections.Counter