diff options
author | Adrian Herrmann <adrian.herrmann@qt.io> | 2024-06-06 10:59:31 +0200 |
---|---|---|
committer | Adrian Herrmann <adrian.herrmann@qt.io> | 2024-06-20 16:10:46 +0000 |
commit | ba2582125f6c9d470d3a5f4e1e61666de9101e0e (patch) | |
tree | cb04e0b4a90e02e0d6026309447fbcf08a8e00a0 /sources/pyside-tools/qml.py | |
parent | 7bb9c0e2f81ec474bf98690b4f90f195a6ea27c8 (diff) |
Use modern typing syntax
We can already use the modern typing syntax introduced with Python 3.10
in 3.9 via future statement definitions, even before we raise the
minimum Python version to 3.10.
Note that direct expressions with "|" don't work yet.
Task-number: PYSIDE-2786
Change-Id: Ie36c140fc960328322502ea29cf6868805a7c558
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside-tools/qml.py')
-rw-r--r-- | sources/pyside-tools/qml.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sources/pyside-tools/qml.py b/sources/pyside-tools/qml.py index a42fdf6e8..d36e86347 100644 --- a/sources/pyside-tools/qml.py +++ b/sources/pyside-tools/qml.py @@ -12,7 +12,6 @@ import sys import os from pathlib import Path from pprint import pprint -from typing import List, Set from PySide6.QtCore import QCoreApplication, Qt, QLibraryInfo, QUrl, SignalInstance from PySide6.QtGui import QGuiApplication, QSurfaceFormat @@ -21,7 +20,7 @@ from PySide6.QtQuick import QQuickView, QQuickItem from PySide6.QtWidgets import QApplication -def import_qml_modules(qml_parent_path: Path, module_paths: List[Path] = []): +def import_qml_modules(qml_parent_path: Path, module_paths: list[Path] = []): ''' Import all the python modules in the qml_parent_path. This way all the classes containing the @QmlElement/@QmlNamedElement are also imported @@ -43,7 +42,7 @@ def import_qml_modules(qml_parent_path: Path, module_paths: List[Path] = []): elif module_path.exists() and module_path.suffix == ".py": search_file_paths.append(module_path) - def import_module(import_module_paths: Set[Path]): + def import_module(import_module_paths: set[Path]): """Import the modules in 'import_module_paths'""" for module_path in import_module_paths: module_name = module_path.name[:-3] |