Pytype

Latest version: v2024.10.11

Safety actively analyzes 723158 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 11 of 34

2022.07.18

Bug fixes:
* Look up methods properly on classes with _HAS_DYNAMIC_ATTRIBUTES.
* Handle .pyi-1 files in load_pytd.Module.is_package().
* Adjust opcode line numbers for return statements in python 3.10+.
* Remove optimize.Factorize, which unnecessarily flattens overloaded functions.
* Fix coroutine signatures in overriding_checks.
* Handle generic types correctly in signature compatibility checks.
* Respect NoReturn annotations even when maximum depth is reached.

2022.06.30

Updates:
* Add the option to show kythe facts in the debug indexer.
* Add a command-line argument `pickle-metadata` to pass metadata to pytype to
store during serialization to a pickle file.

Bug fixes:
* Make slight improvements to --overriding-default-value-checks.
* Preserve comments when preprocessing source code.

2022.06.23

Updates:
* Support `T1 | T2 | ...` syntax for union types in python 3.10+ (PEP604).
* Replace libcst with ast in directors.py in Python 3.9+. This makes source code
parsing much faster.

Bug fixes:
* Python 3.10 fixes:
* Convert `types.NoneType` to `builtins.NoneType`.
* Adjust the error line number for an implicit `return None`.
* Add `ParamSpecArgs` and `ParamSpecKwargs` to `typing.pytd`.

2022.06.14

Updates:
* Add a stub and overlay for the 'attrs' module.

Bug fixes:
* Fix parameterized attributes for dataclass subclasses.
* Mark dict views as reversible in Python 3.8+.
* Add missing memoryview.nbytes attribute.
* Fix chained attribute traces for python 3.10.

2022.06.06

Updates:
* Remove --enable-nested-classes, which has been a no-op since the last release.
* Support `__all__ += [...]` in pyi files.
* Add support for the TypedDict functional constructor.
* Add a `--backup` option to merge_pyi to copy the source file when overwriting.
* Add a merge_project binary to recursively merge files in a project.

Bug fixes:
* Preserve precise element types when adding two fixed-length tuples.
* Raise a meaningful exception when unpickling a pytd file fails.
* Don't check Literals when expanding compatible builtins.
* Fix a crash when applying a method decorator to a property.
* Fix some off-by-one errors in sequence unpacking.
* Fix a tuple addition crash.
* Fix a crash in the indexer.

2022.05.19

Updates:
* Default --enable-nested-classes to True. This flag will be removed in an
upcoming release.
* Use argument-by-argument matching for PyTDFunction in simple cases.

Bug fixes:
* Load symbols from typing when converting parametrised collection classes.
* Raise an error when referencing a nonexistent pyi file in another pyi file.
* Take `__all__` into account when importing `*` in pyi files.
* Support `from x import y` for stdlib modules in pickled pyi files.
* Preprocess source code to augment bare annotations in functions.
* Slightly change the format of the [signature-mismatch] error.
* Switch resolution order for nested and top-level classes in AddNamePrefix.

Page 11 of 34

Links

Releases

Has known vulnerabilities

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.