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
This is a continuation of #186 and, like that change, has also been reported to mypy. I propose reading onto the following line for comments:
importcollectionsfromtypingimportDefaultDict, Listdeftest(pools):
really_long_attribute=collections.defaultdict(list)
# type: DefaultDict[str, List[str]]forpoolinpools:
pass# meaningful stuff in here
This seems clear enough and should require minimal changes to the parser. I'm happy to propose an amendment to the PEP, but I'd like to get some input first.
The text was updated successfully, but these errors were encountered:
I'm -1 on this. I don't think it is needed and is not clear. People will get confused and sometimes think that types come on the line before the definition. If you find your lines are getting too long due to types, you should use an alias. This is much more logical and unambiguous. A line is a definite encapsulation of an idea, and I don't think breaking that is a good idea.
Another solution is to add a backslash (\) to the end of the statement and
put the comment on the next line. There's nothing wrong with a backslash in
this situation. (In fact we should add this solution to PEP 8's section on
how to format types.)
This is a continuation of #186 and, like that change, has also been reported to mypy. I propose reading onto the following line for comments:
This seems clear enough and should require minimal changes to the parser. I'm happy to propose an amendment to the PEP, but I'd like to get some input first.
The text was updated successfully, but these errors were encountered: