nmcontrol icon indicating copy to clipboard operation
nmcontrol copied to clipboard

PEP 8 compliance

Open JeremyRand opened this issue 10 years ago • 4 comments

We should make sure that our code is PEP 8 compliant, particularly before many people are relying on noncompliant aspects of the current codebase.

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

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/9238736-pep-8-compliance?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github).

JeremyRand avatar Mar 05 '15 20:03 JeremyRand

I usually use this style with the difference of camelCase for variable/instance names. IMHO it is enough to improve as we go, though.

phelixbtc avatar Mar 06 '15 09:03 phelixbtc

Generally, I'd like to use PEP 8 rather than mixedCase. We've already gotten a complaint from another developer about that. The sooner we change it, the less it will mess other people up.

JeremyRand avatar Mar 27 '15 03:03 JeremyRand

@phelixbtc do you have any objection if we use the PEP 8 variable/instance naming style? I really want to get that fixed before we start guaranteeing a stable API.

JeremyRand avatar Apr 09 '15 06:04 JeremyRand

IMHO PEP8 is broken in that instance names do not reflect class names. Because of this I would prefer PEP8 with camelCase for variables and instances. All function names should be lower_case_with_underscores. I think only function names are relevant for the API so it should be sufficient to change these? (http://stackoverflow.com/questions/1175208/elegant-python-function-to-convert-camelcase-to-camel-case)

phelixbtc avatar Apr 09 '15 08:04 phelixbtc