Pyanalyze

Latest version: v0.13.1

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

Scan your dependencies

Page 1 of 3

0.13.1

- Use Trusted Publishing to publish releases (806)

0.13.0

- Flag use of generators that are immediately discarded (800)
- Fix crash on some occurrences of `ParamSpec` in stub files (797)
- Fix crash when Pydantic 1 is installed (793)
- Fix error on use of TypeVar defaults in stubs (PEP 696). The
default is still ignored, but now the TypeVar is treated as
if it has no default. (791)
- Add new error code `unsafe_comparison`, which gets triggered
when two values are compared that can never be equal. (784)
- Improve representation of known module, function, and type objects
in error messages (788)
- Add a mechanism to allow overriding the global variables in an
analyzed module. Use this mechanism to set the type of
`qcore.testing.Anything` to `Any`. (786)
- Rename the `is_compatible` and `get_compatibility_error` functions
to `is_assignable` and `get_assignability_error` to align with the
terminology in the typing spec (785)
- Fix binary operations involving unions wrapped in `Annotated` (779)
- Fix various issues with Python 3.13 and 3.14 support (773)
- Improve `ParamSpec` support (772, 777)
- Fix handling of stub functions with positional-only parameters with
defaults (769)
- Recognize exhaustive pattern matching (766)
- Narrow the types of variables assigned within complex patterns (766)
- New error code `generator_return` is raised when a generator does not
return an iterable type, or an async generator does not return an async
iterable type (756)
- Fix type narrowing for certain conditionals using `or` (755)
- Fix incorrect `undefined_name` errors when a class is nested in a nested
function and uses a name from the outer function (750)
- Fix incorrect `possibly_undefined_name` error on certain uses of the
walrus operator (749)
- Fix narrowing on `isinstance` calls with arguments that are not
instances of `type`, such as unions and certain typing special forms (747)
- Detect invalid calls to `isinstance` (747)
- Support calls to `TypeVar` and several other typing constructs in
code that is not executed (e.g., under `if TYPE_CHECKING`) (746)
- Fix spurious errors for the class-based syntax for creating
`NamedTuple` classes (746)
- Make error registry into a custom class instead of an enum, removing
dependency on `aenum` (739)
- Treat subclasses of `int` as subclasses of `float` and `complex` too (738)
- Fix crash on encountering certain decorators in stubs (734)
- Fix inference of signature for certain secondary methods (732)

0.12.0

New features

- Add support for the `ReadOnly` type qualifier (PEP 705) and
for the `closed=True` TypedDict argument (PEP 728) (723)
- Add support for `TypeIs` from PEP 742 (718)
- More PEP 695 support: generic classes and functions. Scoping rules
are not yet fully implemented. (703)
- Add special handling for `dict.__delitem__` (723, 726)

Compatibility fixes

- Make tests pass with latest release of `typeshed_client` (727)
- Fix Protocol compatibility issue with Python 3.13 and an upcoming
release of typing-extensions (716)

Other bugs

- Fix some higher-order behavior of `TypeGuard` and `TypeIs` (719)
- Fix type inference when constructing user-defined generic classes
(703)
- Fix bug in type compatibility check between known-length sequence
types and literal values (701)

0.11.0

- Partial support for PEP 695-style type aliases. Scoping changes
are not yet fully implemented. (690, 692)
- Fix tests to account for new `typeshed_client` release
(694)
- Add option to disable all error codes (659)
- Add hacky fix for bugs with hashability on type objects (689)
- Show an error on calls to `typing.Any` (688)
- Add command-line option `-c`/`--code` to typecheck code from
the command line (685)
- Add a `pyanalyze.extensions.EnumName` predicate and infer it
as the value for the `.name` attribute on enums. Also fix
type inference for enum "properties" on Python 3.11 and up. (682)
- Allow `pyanalyze.runtime.is_compatible` to be used to narrow
types (681, 687)
- Fix usage of `assert_type()` with `Any` and with unions of
`Annotated` objects (680)
- Support inferring `MinLen` and `MaxLen` annotations based
on `len()` checks (680)
- Expose a convenience API for runtime type checking in the
`pyanalyze.runtime` module (674)
- Support for annotations from the `annotated-types` library (673)
- Detect undefined attributes on Pydantic models (670)
- Remove duplicate "attribute_is_never_set" error for classes
with predefined attributes (670)
- Add hook for overriding the value inferred for attributes on
literals (669)
- Support classes that set a `__signature__` attribute to
define their constructor signature (such as Pydantic models) (665)
- Declare support for Python 3.12. Not all new features in
Python 3.12 are supported yet. (656)
- Fix treatment of `property` by the `incompatible_override`
check (653)
- Drop support for Python 3.7 (654)
- Add hardcoded support for `pytest.raises` to avoid false
positives (651)
- Fix crash with nested classes in stubs. For now, `Any` is
inferred for such classes (647)
- Add `disallowed_imports` configuration option to disallow
imports of specific modules (645, 646)
- Consider an annotated assignment without a value to be
an exported name (644)
- Improve the location where `missing_parameter_annotation`
errors are reported (643)
- Add support for suppressing errors in blocks based on
`sys.platform` and `sys.version_info` checks (641)
- Fix compatibility between stub-only callable classes
and the bare `Callable` annotation (640)
- Add new error code `missing_generic_parameters` (off by
default) that flags missing parameters to generic types
such as `list` (637)
- Add new error code `reveal_type` for `reveal_type()`
and similar functions, which previously emitted
`inference_failure` (636)
- Take into account additional base classes declared in stub
files (fixing some false positives around `typing.IO`) (635, 639)
- Fix crash on stubs that contain dict or set literals (634)
- Remove more old special cases and improve robustness of
annotation parsing (630)
- Remove dependency on `typing_inspect` (629)
- Fix use of `Literal` types with `typing_extensions` 4.6.0 (628)

0.10.1

- Fix errors with protocol matching on `typing_extensions` 4.6.0
(626)
- Fix false positive error when annotations refer to classes defined
inside functions (624)

0.10.0

- Infer the signature for built-in static methods, such as `dict.fromkeys` (619)
- Fix type inference for subscripting on `Sequence` (618)
- Improve support for Cythonized methods (617)
- Add support for the PEP 698 `override` decorator (614)
- Add support for `__new__` methods returning `typing.Self`, fixing
various failures with the latest release of `typeshed-client` (615)
- Add support for importing stub-only modules in other stubs (615)
- Fix signature compatibility bug involving `**kwargs` and positional-only
arguments (615)
- Fix type narrowing with `in` on enum types in the negative case (606)
- Fix crash when `getattr()` on a module object throws an error (603)
- Fix handling of positional-only arguments using `/` syntax in stubs (601)
- Fix bug where objects with a `__call__` method that takes `*args` instead
of `self` were not considered callable (600)
- Better typechecking support for async generators (594)

Page 1 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.