aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/PySide2
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2020-04-19 16:46:18 +0200
committerChristian Tismer <tismer@stackless.com>2020-04-21 13:20:45 +0200
commit205f77e056cc1bf0b48ac334fb106c1490d84f77 (patch)
treeb20c75523a1976985ee061c1cc52b0e680f441a4 /sources/pyside2/PySide2
parentb0bfeaf894344e31b5175dbbd3ce371fae5dee5b (diff)
signature: Fix and simplify for mypy compatibility
There was a problem with the typing module for Python2 that showed the wrong name. The generated signature files are further simplified. They no longer contain fancy definitions like "Char", which made little sense and was replaced by "int", which our competitor does as well. The mypy compatibility should be considered mostly complete. Update.. QChar was not changed to "int" but "str" because we got clashes. Therefore, recreation of the registry was necessary. Hard to solve stay the definitions "Virtual, Missing, Invalid, Default, Instance". They are very rarely used for special cases. Mypy cannot see these definitions since the module path does not exist in the file system. I tried hard to fix this by building a mypy plugin, but I seem to be forced to generate real files in a temp dir. This was too much effort. A plugin may make sense in the future when we need to improve the type support. Change-Id: Id80c2da1a4a379a80ec5f3019a916a9c00cc87ff Task-number: PYSIDE-1100 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/pyside2/PySide2')
-rw-r--r--sources/pyside2/PySide2/support/generate_pyi.py1
1 files changed, 0 insertions, 1 deletions
diff --git a/sources/pyside2/PySide2/support/generate_pyi.py b/sources/pyside2/PySide2/support/generate_pyi.py
index f173ec2fc..f92367c82 100644
--- a/sources/pyside2/PySide2/support/generate_pyi.py
+++ b/sources/pyside2/PySide2/support/generate_pyi.py
@@ -142,7 +142,6 @@ class Formatter(Writer):
self.print(" import typing")
self.print("except ImportError:")
self.print(" from PySide2.support.signature import typing")
- self.print("from PySide2.support.signature import typing")
self.print("from PySide2.support.signature.mapping import (")
self.print(" Virtual, Missing, Invalid, Default, Instance)")
self.print()