aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-03-16 08:27:19 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-03-29 09:58:55 +0000
commit8471ae7a61b61597d89ac5c28d3cd6e133a47400 (patch)
treef973fc8f4cd08a0ba7325d8d5f8638cf145bc722 /sources/pyside6
parent9289a63d85eaab0a7f286000e07843d3387f8c26 (diff)
Write conversions as typing.Union[]
Extract all implicit conversions and write them as typing.Union[]. The optional_replacer was fixed, build_brace_pattern needed a separator to be able to continue. Missing mappings are added. Task-number: PYSIDE-1520 Change-Id: I2d8e4e7b8f1586036cc3ec9cf469a27e693e7312 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'sources/pyside6')
-rw-r--r--sources/pyside6/PySide6/support/generate_pyi.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/sources/pyside6/PySide6/support/generate_pyi.py b/sources/pyside6/PySide6/support/generate_pyi.py
index 2810d37e5..233bc9142 100644
--- a/sources/pyside6/PySide6/support/generate_pyi.py
+++ b/sources/pyside6/PySide6/support/generate_pyi.py
@@ -120,7 +120,7 @@ class Formatter(Writer):
# I tried hard to replace typing.Optional by a simple override, but
# this became _way_ too much.
# See also the comment in layout.py .
- brace_pat = build_brace_pattern(3)
+ brace_pat = build_brace_pattern(3, ",")
pattern = fr"\b Union \s* \[ \s* {brace_pat} \s*, \s* NoneType \s* \]"
replace = r"Optional[\1]"
optional_searcher = re.compile(pattern, flags=re.VERBOSE)