aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/doc/developer
diff options
context:
space:
mode:
authorChristian Tismer <[email protected]>2024-11-12 11:44:22 +0100
committerChristian Tismer <[email protected]>2024-11-21 17:47:10 +0100
commit5825e86a3a13b817af4073da9dedfca9f04c7bd3 (patch)
tree84b270ab655eebcc486712ba83714f5de5268c5c /sources/pyside6/doc/developer
parentd03c8661e0bf1c2d094155b39eca00674dcd2ff2 (diff)
type hints: Use positional parameters according to PEP 570
This change would have been very simple (basically one constant) if there were not mypy which needed more effort to stay correct. Change-Id: I464b0522f9d174c5a302f85caf2fcbe202dcaed2 Pick-to: 6.8 Fixes: PYSIDE-2624 Task-number: PYSIDE-2846 Reviewed-by: Friedemann Kleint <[email protected]>
Diffstat (limited to 'sources/pyside6/doc/developer')
-rw-r--r--sources/pyside6/doc/developer/mypy-correctness.rst12
1 files changed, 7 insertions, 5 deletions
diff --git a/sources/pyside6/doc/developer/mypy-correctness.rst b/sources/pyside6/doc/developer/mypy-correctness.rst
index 8f0d63a1d..41ade9309 100644
--- a/sources/pyside6/doc/developer/mypy-correctness.rst
+++ b/sources/pyside6/doc/developer/mypy-correctness.rst
@@ -144,11 +144,13 @@ Disagreement with inconsistent overloads
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If there is a mixed overloading of methods and static or class methods, mypy
-believes this is an error. In a few cases we have this situation, and since
-this is again treated as a "misc" error, we only disable this when it
-happens. See function ``is_inconsistent_overload()`` of module
-``pyi_generator`` which checks if "self" is always or never an argument.
-This is again marked by an inline comment "# type: ignore[misc]".
+believes this is an error. In a first version, we fixed this rare situation
+by suppressing this "misc" error. But when moving to correct positional-only
+parameters (PEP 570) this suppression created unsolvable follow-up errors.
+The cleaner solution was to remove the static methods and prefer the normal methods.
+
+See function ``is_inconsistent_overload()`` of module
+``layout`` which checks if "self" is always or never an argument.
Conclusion and Future