Incorporate PEP 8 text from Ian Lee to clarify annotation policy
This commit is contained in:
parent
48e4630fce
commit
44c193d765
13
pep-0008.txt
13
pep-0008.txt
|
@ -514,6 +514,19 @@ Other Recommendations
|
|||
def complex(real, imag = 0.0):
|
||||
return magic(r = real, i = imag)
|
||||
|
||||
- Do use spaces around the ``=`` sign of an annotated function definition.
|
||||
Additionally, use a single space after the ``:``, as well as a single space
|
||||
on either side of the ``->`` sign representing an annotated return value.
|
||||
|
||||
Yes: def munge(input: AnyStr):
|
||||
Yes: def munge(sep: AnyStr = None):
|
||||
Yes: def munge() -> AnyStr:
|
||||
Yes: def munge(input: AnyStr, sep: AnyStr = None, limit=1000):
|
||||
|
||||
No: def munge(input: AnyStr=None):
|
||||
No: def munge(input:AnyStr):
|
||||
No: def munge(input: AnyStr)->PosInt:
|
||||
|
||||
- Compound statements (multiple statements on the same line) are
|
||||
generally discouraged.
|
||||
|
||||
|
|
Loading…
Reference in New Issue