Message320139
Slightly off topic but while trying to look at the code I can see a space between function name and parenthesis as below. It's not an invalid syntax but it's mentioned as a pet peeve in PEP 8 to not to have space between function name and parenthesis. I did a simple grep and I could some places where even function definitions have spaces as below. It's a trivial thing but just wanted to post it here and might seem like an invalid syntax for someone new fixing it.
# Lib/xmlrpc/server.py
argspec = inspect.formatargspec (
# simple grep and manual scanning with `rg '\w+ \(' | grep -v -E 'if|while|for|except|return' | grep '.py' | less`
Tools/gdb/libpython.py: def __init__ (self, gdbval):
Tools/gdb/libpython.py: def to_string (self):
Tools/gdb/libpython.py:def register (obj):
Tools/gdb/libpython.py:register (gdb.current_objfile ())
Tools/gdb/libpython.py: gdb.Command.__init__ (self,
Tools/gdb/libpython.py: gdb.Command.__init__ (self,
Tools/gdb/libpython.py: gdb.Command.__init__ (self,
Tools/gdb/libpython.py: gdb.Command.__init__ (self,
Tools/gdb/libpython.py: gdb.Command.__init__ (self,
# Relevant PEP 8 section : https://www.python.org/dev/peps/pep-0008/#pet-peeves
> Immediately before the open parenthesis that starts the argument list of a function call:
> Yes: spam(1)
> No: spam (1)
Also I think it will be good if a deprecation is made then it has to run the test suite with `-Werror` so that the deprecations are fixed which is slightly subjective though where deprecations are reverted back in a future version for reasons like easy 2to3 porting.
Thanks much for these easy issues and I hope someone takes it up. |
|
Date |
User |
Action |
Args |
2018-06-21 05:55:23 | xtreak | set | recipients:
+ xtreak, vstinner, yselivanov |
2018-06-21 05:55:23 | xtreak | set | messageid: <1529560523.56.0.56676864532.issue33911@psf.upfronthosting.co.za> |
2018-06-21 05:55:23 | xtreak | link | issue33911 messages |
2018-06-21 05:55:23 | xtreak | create | |
|