0.5.0
Version 0.5.0 (December 12, 2021)
Highlights:
- Partial support for
@overload
- Support for
Protocol
- Type check calls with
*args
or**kwargs
Full changelog:
- Recognize code following an infinite while loop as unreachable (#337)
- Recognize overloaded functions in stubs (#325)
- Fix handling of classes in stubs that have an incorrect
__qualname__
at runtime (#336) - Fix type compatibility with generic functions (#335)
- Support function calls in annotations (#334)
- Better support for
TypeVar
bounds and constraints in stubs (#333) - Improve type checking of
dict.update
anddict.copy
(#328) - Improve support for complex type aliases in stubs
(#331) - Limit special case for
Literal
callables to
functions, not any callable (#329) - Support for constants in stubs that do not exist
at runtime (#330) - Fix detection of PEP 604 union types in stubs (#327)
- Support literals over negative numbers in stubs
and stringified annotations (#326) - Improved overload matching algorithm (#321) (#324)
- Support runtime overloaded functions with
pyanalyze.extensions.overload
(#318) - Internal support for overloaded functions (#316)
- Support
TypeVar
bounds and constraints (#315) - Improve error messages involving concrete dictionary and sequence values (#312)
- More precise type inference for dict literals (#312)
- Support
AsynqCallable
with no arguments as an annotation (#314) - Support iteration over old-style iterables providing only
__getitem__
(#313) - Add support for runtime Protocols (#311)
- Stop inferring
Any
for non-runtime checkable Protocols on Python 3.6 and 3.7 (#310) - Fix false positive where
multiprocessing.Pool.map_async
was identified as an asynq method (#306) - Fix handling of nested classes (#305)
- Support Protocols for runtime types that are also defined in stubs (#297) (#307)
- Better detect signatures of methods in stub files (#304)
- Improve handling of positional-only arguments in stub files (#303)
- Fix bug where pyanalyze incorrectly inferred that an attribute always exists (#302)
- Fix compatibility of signatures with extra parameters (#301)
- Enhance
reveal_type()
output forUnboundMethodValue
(#300) - Fix handling of
async for
(#298) - Add support for stub-only Protocols (#295)
- Basic support for stub-only types (#290)
- Require
typing_inspect>=0.7.0
(#290) - Improve type checking of
raise
statements (#289) - Support
Final
with arguments andClassVar
without arguments (#284) - Add
pyanalyze.extensions.NoAny
(#283) - Overhaul documentation (#282)
- Type check calls with
*args
or**kwargs
(#275) - Infer more precise types for comprehensions over known iterables (#279)
- Add impl function for
list.__iadd__
(+=
) (#280) - Simplify some overly complex types to improve performance (#280)
- Detect usage of implicitly reexported names (#271)
- Improve type inference for iterables (#277)
- Fix bug in type narrowing for
in
/not in
(#277) - Changes affecting consumers of
Value
objects:- All
Value
objects are now expected to be hashable. DictIncompleteValue
andAnnotatedValue
use tuples instead of lists internally.DictIncompleteValue
now stores a sequence ofKVPair
object instead
of just key-value pairs, enabling more granular information.- The type of a
TypedValue
may now be a string
- All