Request: Optional config to warn when a parameter annotation could use Mapping
instead of Dict
or Sequence
instead of List
#8484
Labels
Mapping
instead of Dict
or Sequence
instead of List
#8484
Feature request
Basically, I think it would be nice if mypy could warn when the user could be giving their function immutable versions of the argument types instead of mutable ones. For example:
Being prompted to use immutable types when you're not mutating the input could improve the usability of mypy quite a bit since it would result in functions who's parameters are covariant much more often. It's also convenient to know when a function isn't mutating its arguments based on its annotation, and the desire to default to using immutable types wherever possible probably makes sense for a lot of users.
The text was updated successfully, but these errors were encountered: