0.7.0
Release highlights:
- Support for PEP 673 (
Self) - Support for PEP 675 (
LiteralString) - Support for
assert_typeand other additions totypingin Python 3.11
Full changelog:
- Remove
SequenceIncompleteValue(#519) - Add implementation function for
dict.pop(#517) - Remove
WeakExtension(#517) - Fix propagation of no-return-unless constraints from calls
to unions (#518) - Initial support for variable-length heterogeneous sequences
(required for PEP 646). More precise types are now inferred
for heterogeneous sequences containing variable-length
objects. (#515, #516) - Support
LiteralString(PEP 675) (#514) - Add
unused_assignmenterror code, separated out from
unused_variable. Enable these error codes and
possibly_undefined_nameby default (#511) - Fix handling of overloaded methods called on literals (#513)
- Partial support for running on Python 3.11 (#512)
- Basic support for checking
Finaland for checking re-assignments
to variables declared with a specific type (#505) - Correctly check the
selfargument to@propertygetters (#506) - Correctly track assignments of variables inside
tryblocks
and insidewithblocks that may suppress exceptions (#504) - Support mappings that do not inherit from
collections.abc.Mapping
(#501) - Improve type inference for calls to
set(),list(), and
tuple()with union arguments (#500) - Remove special-cased signatured for
sorted()(#498) - Support type narrowing on
bool()calls (#497) - Support context managers that may suppress exceptions (#496)
- Fix type inference for
withassignment targets on
Python 3.7 and higher (#495) - Fix bug where code after a
whileloop is considered
unreachable if allbreakstatements are inside ofif
statements (#494) - Remove support for detecting properties that represent
synchronous equivalents of asynq methods (#493) - Enable exhaustive checking of enums and booleans (#492)
- Fix type narrowing in else branch if constraint is stored in a
variable (#491) - Fix incorrectly inferred
Neverreturn type for some function
implementations (#490) - Infer precise call signatures for
TypedDicttypes (#487) - Add mechanism to prevent crashes on objects
with unusual__getattr__methods (#486) - Infer callable signatures for objects with a
__getattr__method (#485, #488) - Do not treat attributes that raise an exception on access
as nonexistent (#481) - Improve detection of unhashable dict keys and set members (#469)
- The
inandnot inoperators always return
booleans (#480) - Allow
NotImplementedto be returned from special
methods that support it (#479) - Fix bug affecting type compatibility between
generics and literals (#474) - Add support for
typing.Neverandtyping_extensions.Never(#472) - Add
inferred_any, an extremely noisy error code
that triggers whenever the type checker infers something asAny(#471) - Optimize type compatibility checks on large unions (#469)
- Detect incorrect key types passed to
dict.__getitem__(#468) - Pick up the signature of
open()from typeshed correctly (#463) - Do not strip away generic parameters explicitly set to
Any(#467) - Fix bug that led to some overloaded calls incorrectly
resolving toAny(#462) - Support
__init__and__new__signatures from typeshed (#430) - Fix incorrect type inferred for indexing operations on
subclasses oflistandtuple(#461) - Add plugin providing a precise type for
dict.getcalls (#460) - Fix internal error when an
__eq__method throws (#461) - Fix handling of
async defmethods in stubs (#459) - Treat Thrift enums as compatible with protocols that
intis compatible with (#457) - Assume that dataclasses have no dynamic attributes (#456)
- Treat Thrift enums as compatible with
int(#455) - Fix treatment of
TypeVarwith bounds or constraints
as callables (#454) - Improve
TypeVarsolution algorithm (#453) - Cache decisions about whether classes implement protocols (#450)
- Fix application of multiple suggested changes per file
when an earlier change has added or removed lines (#449) - Treat
NoReturnlikeAnyin**kwargscalls (#446) - Improve error messages for overloaded calls (#445)
- Infer
NoReturninstead ofAnyfor unreachable code (#443) - Make
NoReturncompatible with all other types (#442) - Fix treatment of walrus operator in
and,or, andif/else
expressions (#441) - Refactor
isinstance()support (#440) - Exclude
Any[unreachable]from unified values (#439) - Add support for
reveal_locals()(#436) - Add support for
assert_error()(#435) - Add support for
assert_type()(#434) reveal_type()anddump_value()now return their argument,
the anticipated behavior fortyping.reveal_type()in Python
3.11 (#433)- Fix return type of async generator functions (#431)
- Type check function decorators (#428)
- Handle
NoReturninasync deffunctions (#427) - Support PEP 673 (
typing_extensions.Self) (#423) - Updates for compatibility with recent changes in typeshed (#421):
- Fix override compatibility check for unknown callables
- Fix usage of removed type
_typeshed.SupportsLessThan
- Remove old configuration abstraction (#414)