Python identifiers, PEP 8, and consistency
Python identifiers, PEP 8, and consistency
Posted Dec 1, 2021 19:35 UTC (Wed) by NYKevin (subscriber, #129325)In reply to: Python identifiers, PEP 8, and consistency by epa
Parent article: Python identifiers, PEP 8, and consistency
> That doesn’t do much for studlyCaps versus underscores, I admit. I guess if you must have aliases, they should be declared specially so that linter tools (and the compiler’s own diagnostics) can help the programmer. They should not just be a bunch of wrapper functions.
You don't need wrapper functions in Python. Python functions and classes are first-class objects, so you can just do this:
def original_name(args...): ...
alias = original_name
If a linter is unable to figure that out, it needs to be redesigned from the ground up.
* Except for the case-insensitive strings. Those are terrible.
