4 ms·
IIRC, pep8 would have you write: def my_very_very_very_very_very_long_function_name(self, param1,
by weberc2 8y ago
IIRC, pep8 would have you write:
def my_very_very_very_very_very_long_function_name(self,
param1,
param2):
- Franciscouzo 8y agoYou can choose to use: def my_very_very_very_very_very_long_function_name( self, param1, param2): ...
- weberc2 8y agoAh, my mistake.
- scott_s 8y agoLooking at it (https://www.python.org/dev/peps/pep-0008/ https://www.python.org/dev/peps/pep-0008/), that is one of the options, but you could also do: def my_very_very_very_very_very_long_function_name( self, param1, param2): pass Shrug. Seems okay to me, and preferable to what they say no to.
- rand_r 8y agoMy preference is to do this, which I think is quite nice and easy to work with: def my_very_very_very_very_very_long_function_name( self, param1, param2, ): do_it() # function body here.
- blueprint 8y agoYup this. It works perhaps even more nicely in languages that have braces and return types, e.g. func some_name( arg: Type, arg2: Type ) -> RetVal { … }
- dguaraglia 8y agoYep, this is by far my least favorite autopep8 "correction".
- baby 8y agoif your function name is that long, you have a problem