-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Type-annotate all function arguments and internal variables #8351
Comments
|
This isn't blocked? Python 3.5 supports type annotations. |
not variable type annotations, but you're right about it not being completely blocked |
A large portion of this can be fixed with |
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. |
I found some interesting https://mypy.readthedocs.io/en/stable/error_code_list2.html
|
I think this is essentially a duplicate of #11271. |
Description:
Related to #8347,
(partially) blocked till 3.5 is deprecatedThe goal is to;
name = ... # type:
comments toname: type = ...
. (see "com2ann
progress" below)name: type
annotations on;__init__()
functions), unless;self.thing = Thing()
) (dubious, see Use inline type hints inhandlers/
andrest/
#10382 (comment))1
,b""
,""
, etc. but notNone
)self.thing = hs.get_another_thing()
), given that the function signature is known and inferrable.com2ann
progresstests/
(Use inline type hints intests/
#10350)synapse/
handlers/
andrest/
#10382http/federation/
,storage/
andutil/
#10381synapse/
) #10380(
com2ann
changes comment type annotations to inline type annotations,name = ... # type:
toname: type = ...
, this is possible since python 3.6, and standard across the python ecosystem.)The text was updated successfully, but these errors were encountered: