Skip to content

πŸŽ› πŸ”Š A Python library for audio.

Remove __init__ type hints for classes that override __new__.

Peter Sobotf192733ee3c2
diff --git a/scripts/postprocess_type_hints.py b/scripts/postprocess_type_hints.py
index 60cc343..ceed73a 100644
--- a/scripts/postprocess_type_hints.py
+++ b/scripts/postprocess_type_hints.py
@@ -64,6 +64,9 @@ REPLACEMENTS = [
),
# Remove type hints in docstrings, added unnecessarily by pybind11-stubgen
(r".*?:type:.*$", ""),
+ # MyPy chokes on classes that contain both __new__ and __init__.
+ # Remove all bare, arg-free inits:
+ (r"def __init__\(self\) -> None: ...", ""),
]
REMOVE_INDENTED_BLOCKS_STARTING_WITH = [