You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Users find it surprising because it seems obvious that mypy should know the variable is of the narrower type. There was a big discussion in typing-sig and all the type checkers agreed this behaviour was probably the best. The change is very easy, but exposes bugs in binder
It's hard to really use Literal types without a good way to narrow them. We should also narrow on ==. I think last time I tried this it exposed bugs in binder
There's maybe some other UI stuff we can think about for groups of flags and error codes, as discussed in meetup. I also don't like the new --extra-checks since flag name doesn't mean anything and can't be decomposed.
It would be nice to be able to opt-in to treating packages missing py.typed as having py.typed. mypy can still provide a lot of value just based on function shape.
Currently --exclude only affects file discovery on command line, not import following. This is a source of frustration for users because the relevant modules can still end up being type checked.
This is the sequel to #11201. It's awesome to see most of the things in that issue fixed.
Type System Features
@deprecated
) #16111Behaviour changes
Ternary unions Use union instead of join for unifying types #12056We should use unions in some places we currently join, see Use union instead of join for unifying types #12056 (comment)
Update: We now use unions in more places, including ternary expressions. Feel free to investigate this more though!
Always narrow types Types not added to binder on initial assignment #2008 (comment) (proposal 3)
Users find it surprising because it seems obvious that mypy should know the variable is of the narrower type. There was a big discussion in typing-sig and all the type checkers agreed this behaviour was probably the best. The change is very easy, but exposes bugs in binder
Default value of generic parameters Unable to specify a default value for a generic parameter #3737 (comment)
It's totally reasonable to want to have generic parameters with defaults, we should error at call sites in case of badness
Support narrowing Literal Narrowing types to
Literal
usingin
syntax #12535It's hard to really use Literal types without a good way to narrow them. We should also narrow on
==
. I think last time I tried this it exposed bugs in binderSupport property setters with broader types What to do about setters of a different type than their property? #3004
Should also allow covariant overrides of getter
Better handling of
__new__
Believe more __new__ return types #16020This is part of the Python language and comes up weirdly frequently.
Love for match statement https://github.com/python/mypy/issues?q=is%3Aopen+label%3Atopic-match-statement+sort%3Areactions-%2B1-desc
I fixed the most popular of these issues, but there's still a long tail of them
PEP 688 Drop bytes/bytearray and bytes/memoryview promotions (PEP 688) #15313
Easy, is just a somewhat breaking change
UI
Per module strict=true bug: strict = true is incompatible with per-module configuration #11401
There's maybe some other UI stuff we can think about for groups of flags and error codes, as discussed in meetup. I also don't like the new
--extra-checks
since flag name doesn't mean anything and can't be decomposed.Ability to override PEP 561 Allow/disallow pep561 packages #8545
It would be nice to be able to opt-in to treating packages missing py.typed as having py.typed. mypy can still provide a lot of value just based on function shape.
Exclude should imply per-module follow_import=skip exclude should imply a per-module follow import skip for matching modules #10377
Currently
--exclude
only affects file discovery on command line, not import following. This is a source of frustration for users because the relevant modules can still end up being type checked.Provide flag to generate stubs requirements (🎁) Improve usability of
--install-types
#10600 (comment)--install-types
is slow, results in unstable type checking, doesn't let users manage their own envs, can fail unclearly if cache isn't writtenRethink stub suggestion logic Improving and evolving stub package suggestions #10619
Our current behaviour was needed to help the migration to modular typeshed, but is not behaviour we'd have designed from scratch.
Gradual typing
Make
check_untyped_defs = True
the default Give an error if there is a variable annotation within a function but no signature #3948 (comment) / Should we eventually type check all function bodies by default? #6646We decided not to do this for mypy 1.0, but could still make sense in the future.
Infer obvious return types Proposal: treat "obvious" return type as annotated #4409 / Proposal: infer obvious parameters and return types #10149
As a 1/3-way measure, we could also do (🎁) Flag to make default return type
None
instead ofAny
#9413Infer method types from superclass untyped defs on derived classes #3903 (comment)
Performance
Misc
Member access Refactor all member access to go through checkmember.py (meta issue) #7724
Merge configuration docs Consider merging command line flags and configuration file options descriptions #12347
See also a similar issue for mypyc here: mypyc/mypyc#785
(other maintainers, feel free to edit)
The text was updated successfully, but these errors were encountered: