Pytype

Latest version: v2024.4.11

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

Scan your dependencies

Page 1 of 34

2024.04.11

Updates:
* Change error message hint to suggest `X | None` rather than `Optional[X]`.

Bug fixes:
* Take the 'maybe_missing_members' attribute into account when setting up enum
classes.
* Fix a bug in signature compatibility checking.
* Teach main.py how to fix unescaped spaces in command-line arguments.
* Fix return type of exit() and quit().
* Update pytype_runner.py - change escape_ninja_path to escape all the ninja
path escape-needing characters
* Modify type annotations for coroutines as soon as they are created.
* Fully promote __init_subclass__ to a classmethod.

2024.03.19

Updates:
* Add 'default' field to pytd.TypeParameter.

Bug fixes:
* Raise an error when a non-class is passed to a class match case.

2024.03.11

Updates:
* Split generate_pyi into separate components for ast and pyi generation.
* Replace `pickle` with `msgspec`.
* Support PEP 742 (TypeIs).
* Update typeshed pin to commit c35b3bc from Mar 8.
* Support typing_extensions.Unpack usage in typeshed.

Bug fixes:
* Fix a corner case with an indefinite case in a match with concrete values.
* Check types as well for dataclasses.replace.
* Export enum values as Literals where possible.
* Remove mystery 'None' from overlays/named_tuple.
* Still do property lookups when maybe_missing_members is set.
* Fix crash in enum_overlay.
* Recognize __func__ attribute on methods.
* Fix a crash when constant-folding an invalid map literal.

2024.02.27

Updates:
* Add support for pragmas to pytype.
* Implement the cache-return pragma.

Bug fixes:
* Track the set of case lines we have encountered, not just the number of them.
* Fix interaction between Self and overload.
* Typo fix in cover_from_cmp.
* Add __match_args__ to dataclasses.
* Add missing __reduce__ method to builtins.object.
* Fix a bug in how we resolve aliases in pyi files.
* Don't crash when using a method as a fiddle config type constructor.

2024.02.13

Bug fixes:
* Fix: pytype.single -> pytype.main.
* Catch UnicodeDecodeError when attempting to read excluded files.
* Add protocol overload to definition of builtins.divmod.

2024.02.09

Updates:
* Remove 'deep' and 'store_all_calls' options.
* Remove duplicate pytype inputs and outputs.

Bug fixes:
* Fix module resolution bug in load_pytd.
* Pattern matching:
* Fix a corner case in pattern matching where the first case is None.
* Fix a corner case when comparing to Any in a case statement.
* Fix a false redundant-match when matching instances of a nonexhaustive type.
* Do not attempt to track matching if we don't recognise a CMP as an instance.
* Do not attempt to track matches if the match variable contains an Any.
* Rework the check for an out-of-order opcode in a match block.
* Fix a crash when calling get() on a TypedDict instance.
* Don't crash when inferring a type for an uncalled attrs.define.
* Handle aliased imports in type stubs better.
* Teach pytype that zip is actually a class.
* Catch bad external types in type annotations.

Page 1 of 34

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.