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
{{ message }}
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Type-annotate all function arguments and internal variables #8351
(com2ann changes comment type annotations to inline type annotations, name = ... # type: to name: type = ..., this is possible since python 3.6, and standard across the python ecosystem.)
Updated description, the previous one was vague and also implied setting type annotations for every variable inside non-init functions, which i think is overdoing it a little bit, type-annotating all other places noted should already correctly resolve those spots.
Activity
clokep commentedon Sep 18, 2020
mypyruns in CI on a subset of the code-base, see https://github.com/matrix-org/synapse/blob/develop/mypy.ini#L9clokep commentedon Sep 18, 2020
This isn't blocked? Python 3.5 supports type annotations.
ShadowJonathan commentedon Sep 18, 2020
not variable type annotations, but you're right about it not being completely blocked
ShadowJonathan commentedon Apr 5, 2021
A large portion of this can be fixed with
com2ann, see #9131 (comment)ShadowJonathan commentedon Jul 9, 2021
Updated description, the previous one was vague and also implied setting type annotations for every variable inside non-init functions, which i think is overdoing it a little bit, type-annotating all other places noted should already correctly resolve those spots.
ShadowJonathan commentedon Jul 15, 2021
I found some interesting
mypyoptional errors that could be enabled to enforce type annotations;https://mypy.readthedocs.io/en/stable/error_code_list2.html
Check that type arguments exist [type-arg]
(Errors on
List, requiresList[<type>])Check that every function has an annotation [no-untyped-def]
Check that comparisons are overlapping [comparison-overlap]
(maybe) Check that no untyped functions are called [no-untyped-call]
Check that function does not return Any value [no-any-return]
clokep commentedon Aug 15, 2022
I think this is essentially a duplicate of #11271.