0.7.0
Release highlights:
- Support for PEP 673 (
Self
) - Support for PEP 675 (
LiteralString
) - Support for
assert_type
and other additions totyping
in 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_assignment
error code, separated out from
unused_variable
. Enable these error codes and
possibly_undefined_name
by default (#511) - Fix handling of overloaded methods called on literals (#513)
- Partial support for running on Python 3.11 (#512)
- Basic support for checking
Final
and for checking re-assignments
to variables declared with a specific type (#505) - Correctly check the
self
argument to@property
getters (#506) - Correctly track assignments of variables inside
try
blocks
and insidewith
blocks 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
with
assignment targets on
Python 3.7 and higher (#495) - Fix bug where code after a
while
loop is considered
unreachable if allbreak
statements 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
Never
return type for some function
implementations (#490) - Infer precise call signatures for
TypedDict
types (#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
in
andnot in
operators always return
booleans (#480) - Allow
NotImplemented
to be returned from special
methods that support it (#479) - Fix bug affecting type compatibility between
generics and literals (#474) - Add support for
typing.Never
andtyping_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 oflist
andtuple
(#461) - Add plugin providing a precise type for
dict.get
calls (#460) - Fix internal error when an
__eq__
method throws (#461) - Fix handling of
async def
methods in stubs (#459) - Treat Thrift enums as compatible with protocols that
int
is compatible with (#457) - Assume that dataclasses have no dynamic attributes (#456)
- Treat Thrift enums as compatible with
int
(#455) - Fix treatment of
TypeVar
with bounds or constraints
as callables (#454) - Improve
TypeVar
solution 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
NoReturn
likeAny
in**kwargs
calls (#446) - Improve error messages for overloaded calls (#445)
- Infer
NoReturn
instead ofAny
for unreachable code (#443) - Make
NoReturn
compatible 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
NoReturn
inasync def
functions (#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)