Message306171
The string representation of a function signature with annotations is currently like this:
>>> def __init__(self, x: int = 1, y: int = 2) -> None: pass
...
>>> import inspect
>>> str(inspect.signature(__init__))
'(self, x:str=1, y:int=2) -> None'
At the same time PEP 8 says:
When combining an argument annotation with a default value, use spaces around the = sign (but only for those arguments that have both an annotation and a default).
Yes:
def munge(sep: AnyStr = None): ...
def munge(input: AnyStr, sep: AnyStr = None, limit=1000): ...
No:
def munge(input: AnyStr=None): ...
def munge(input: AnyStr, limit = 1000): ...
I think there should be spaces in the signature repr. |
|
Date |
User |
Action |
Args |
2017-11-13 22:06:50 | levkivskyi | set | recipients:
+ levkivskyi, yselivanov |
2017-11-13 22:06:50 | levkivskyi | set | messageid: <1510610810.77.0.213398074469.issue32018@psf.upfronthosting.co.za> |
2017-11-13 22:06:50 | levkivskyi | link | issue32018 messages |
2017-11-13 22:06:50 | levkivskyi | create | |
|