Bug fixes: * Call init_class instead of instantiate when adding assertIsInstance bindings. * Use the namedtuple 'defaults' argument when generating __new__ signature. * Do not raise a parser error for unrecognised decorators. * Merge BaseValue.cls and BaseValue.get_class(). * Check Instance.maybe_missing_members earlier during attribute access. * Fix a bug in matching callables with TypeVar parameters.
2021.09.27
New features and updates: * Drop target Python 3.5 support. * Remove the no-op --enforce-noniterable-strings flag. * Support arbitrary python values for typing.Annotated in pyi files. * Add more extensive type support for attr converters.
Bug fixes: * Preserve named args in a function call when we have **kwargs in the arglist. * Allow assertIsInstance to take a tuple of classes. * Fix a bug in matching a Union against a TypeVar. * Attach a line number to function call errors caused by annotating self. * Add some missing namedtuple args.
2021.09.09
New features and updates: * Enable --enforce-noniterable-strings by default and make the flag a no-op. It will be removed in the next release. * Narrow the types of local variables based on test assertions. * For bad return type annotations on generators, change invalid-type-annotation to bad-yield-annotation error. * Slightly improve pytype's performance on a trivial file.
Bug fixes: * Fix our type definition for BaseException.with_traceback(). * Add some missing 3.8 methods to typing stubs. * Add `breakpoint` to the supported builtin methods. * Fix a bug in pytype's handling of late annotations. * Typeshed: fix version parsing regex.
2021.08.24
New features and updates: * Update typeshed pin to commit 8da23e0 from July 30. * Remove all Python 2 compatibility code. * Print method signatures in the error message for a protocol type mismatch. * Raise an error when comparing incompatible primitive types.
Bug fixes: * Fix bugs in constant folding of f-strings. * Fix a bug where typing_extensions.Protocol was treated as Any. * Emit a pyi-error for an invalid annotation in a pyi file instead of crashing. * Add an extra check to forbid matching Mapping too broadly.
2021.08.11
New features and updates: * Stop supporting target Python 2. * Enable constant folding, a performance optimization that significantly speeds up analysis of large data structure literals.
Bug fixes: * Replace ParamSpec.{args,kwargs} with Any.
2021.08.03
New features and updates: * This is the last release of pytype that supports analyzing code in Python 2.7. From the next release onward, pytype will only support Python 3.5+. * Add a typing FAQ. * Add a pytype_extensions.Dataclass protocol for matching any dataclass.
Bug fixes: * Use [invalid-annotation] rather than [not-supported-yet] to report stray TypeVars in variable annotations. * Fix bugs in attribute matching for Protocol. * Fix a bug in pytype's import resolution for relative imports.