Pytype

Latest version: v2024.4.11

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

Scan your dependencies

Page 15 of 34

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.

2021.10.18

New features and updates:
* Completely remove the --attribute-variable-annotations flag. This was a no-op
as of version 2021.10.11.
* Enable --preserve-union-macros by default and make the flag a no-op. It will
be removed in the next release.

Bug fixes:
* Enum overlay: fix crash due to loading `__new__` from a PyTDClass.
* Enum overlay: use ClassVar to differentiate enum class attributes.
* Fix a parser bug involving nested class name conflicts.
* Fix a crash when lazily loading a missing submodule.
* Change PrintVisitor to group explicit imports with the ones collected from
type annotations.

2021.10.11

New features and updates:
* Update pytype and typing annotation stubs for features added in attrs 21.1.0.
* Enable --attribute-variable-annotations by default and make the flag a no-op.
It will be removed in the next release.
* The --use-enum-overlay flag is ready for general use. Enable this flag for
precise typing of the stdlib enum library.

Bug fixes:
* Support quoted types as annotations in pyi files.
* Add precise overloads for the map function.
* Support Ellipsis annotations in pyi files.
* Preserve None in unions containing Any.
* Fix a pyi import printing bug.
* Improve ignored-abstractmethod error message.
* Teach convert._load_late_type to handle nested classes.

Page 15 of 34

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.