If you use mypy or just want to help your IDE understand your types better, you often want to explicitly set the types of your variables (especially if you start with an empty list but already want to specify the type of the content).
In python < 3.6 you do that with comments of the form # type: int, e.g.
If you use
mypy
or just want to help your IDE understand your types better, you often want to explicitly set the types of your variables (especially if you start with an empty list but already want to specify the type of the content).In python < 3.6 you do that with comments of the form
# type: int
, e.g.whereas python >= 3.6 has
cf eg the mypy cheatsheet
It would be very cool to do this conversion automagically with pyupgrade :)