Pytype

Latest version: v2024.10.11

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

Scan your dependencies

Page 15 of 34

2021.11.29

Bug fixes:
* Pass feature flags to the INFER command.

2021.11.24

New features and updates:
* Update typeshed pin to commit 7cc5eb2 from Aug 8.
* Remove pytype's ability to accept python_version=3.
* Rename pytype "master" branch to "main".
* Remove the --gen-stub-imports flag. This was a no-op as of version 2021.11.18.
* Look up local names in nested class scopes when importing pyi files.
* Consistently use "base" instead of "parent" to refer to base classes. This
changes the pickled representation of pytd.Class.

Bug fixes:
* Check for multiple module-level `__getattr__` overloads.
* Raise a not supported error for constructors in type annotations in pyi files.
* Fix a [not-instantiable] false positive.
* Add a feature flag, --fix-module-collisions, to fix a 'duplicate top-level
identifier' pyi issue.
* Don't enforce abstractmethod and coroutine consistency on properties.

2021.11.18

New features and updates:
* Enable --gen-stub-imports by default and make the flag a no-op. It will be
removed in the next release.
* Pass more precise argument types to contextmanager __exit__ methods.
* Add a helpful error message for use-after-delete.

Bug fixes:
* Recognize "/dev/null" as a package path in load_pytd.
* Remove references to the `__builtin__` module.
* Allow disables for invalid calls in 3.9 to be put on the same lines as in 3.7.

2021.11.12

New features and updates:
* Use the official pyi files from attrs.
* Report a type error when comparing types (e.g. int > str) and when calling an
overloaded comparison method like __gt__ fails.
* Ship Linux AArch64 wheels.

Bug fixes:
* Use a homogeneous tuple as a pytd node sort key.
* Fix crash in pytd.Lookup caused by ClassType with unfilled cls pointer.
* Fix a pytd printer bug that was causing us to print 'Optional[import ...]'.
* Fix a pytype bug in matching Literal against Literal.
* Fix a bug in which classmethods weren't detected as protocol members.
* --use-enum-overlay:
* Only add `__new__` to an enum if it has members to lookup.
* Skip potential enum members that are functions or have dunder names.
* Teach the enum overlay what a descriptor is.
* --allow-recursive-types:
* Fix infinite recursion in vm.init_class.
* Support recursive types in sub_one_annotation.
* Add support in visitors.LookupLocalTypes.

2021.11.02

New features and updates:
* Remove the --bind-properties flag. Its behavior has been made the default.
* Take advantage of module aliases to print prettier stub files.
* Add support for cross-module attr.s wrappers.
* Add a feature flag, --gen-stub-imports, to improve pyi import handling.
* Add a bit more support for PEP 612 in stubs.

Bug fixes:
* Add remove{prefix,suffix} methods for bytes, bytearray.
* Fix a bug where Errorlog.copy_from() duplicated error details.
* Fix some issues with handling module aliases in stub files.
* Support a [not-supported-yet] case in a generic class TypeVar renaming check.
* Add `__init__` attributes to canonical enum members.

2021.10.25

New features and updates:
* Completely remove the --preserve-union-macros flag. This was a no-op as of
version 2021.10.17.
* Add a new flag, --build-dict-literals-from-kwargs, to construct dict literals
for `dict(k=v, ...)`. This behavior will ultimately by enabled by default and
the flag removed.
* Add a new flag, --strict_namedtuple_checks, for typing.NamedTuple and
collections.namedtuple to inherit from fixed-length tuples. This behavior will
ultimately be enabled by default and the flag removed.

Bug fixes:
* Fix how the enum overlay calls `base_type.__new__`.
* Improve how the enum overlay chooses base types.
* When an `attr.ib()` call has type errors, construct the attrib anyway.
* Support builtin str removeprefix/removesuffix.

Page 15 of 34

Links

Releases

Has known vulnerabilities

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.