luminousmen / luminousmen.com

2 stars 0 forks source link

https://luminousmen.com/post/the-ultimate-python-style-guidelines #24

Open utterances-bot opened 3 years ago

utterances-bot commented 3 years ago

The ultimate Python style guidelines - Blog | luminousmen

It is way easier to write the code or do a code review by a strictly defined practical style guide for Python, like PEP8 but better

https://luminousmen.com/post/the-ultimate-python-style-guidelines

huydhoang commented 3 years ago

This is the most readable, understandable and complete Python style guide I've read to date. Thanks for sharing your work!

hmoffatt commented 3 years ago

Under 'Code Layout' you wrote 2 indents betwen classes and 1 indent between methods, but you meant blank lines rather than indents I think.

hmoffatt commented 3 years ago

PEP8 says when calling a function and splitting the arguments onto a new line, indent to match the first line. What do you think of this? Personally I hate it, it's a nuisance to create (because it's not necessarily on a tapstop), and it's a nuisance to maintain if the function name changes.

https://www.python.org/dev/peps/pep-0008/#indentation

huydhoang commented 3 years ago

@hmoffatt you mean like this? That's a lot of work if you do manually with spaces. But since black can auto-format it, all I did was Ctrl+S...

    long_function_name(
        first_param,
        second_param,
        third_param,
        very_long_param_name,
        another_very_long_param_name,
    )
hmoffatt commented 3 years ago

@huydhoang no I meant:

    long_function_name(first_param,
                       second_param,
                       third_param,
                       very_long_param_name,
                       another_very_long_param_name)
huydhoang commented 3 years ago

@hmoffatt I see, this kind of indentation is totally unnecessary (and ugly).

luminousmen commented 3 years ago

@hmoffatt, I hate this styling as well :)