Re:Go 1.11 got me to stop ignoring Go
by weberc2 on Tuesday October 09, 2018 @03:28PM
(#18179077)
IIRC, pep8 would have you write:
[ Parent
| on HN ]
Looking at it (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.
Re:Go 1.11 got me to stop ignoring Go
by Franciscouzo on Tuesday October 09, 2018 @03:36PM
(#18179148)
You can choose to use:
def my_very_very_very_very_very_long_function_name(
self, param1, param2):
...Ah, my mistake.
My 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.Yup 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 {
…
}
Re:Go 1.11 got me to stop ignoring Go
by dguaraglia on Tuesday October 09, 2018 @04:17PM
(#18179466)
Yep, this is by far my least favorite autopep8 "correction".