What are some good and bad names you've encountered in Python code?
1–10 of 11 posts
Re: What are some good and bad names you've encountered in Python code?
#2Re: What are some good and bad names you've encountered in Python code?
#3Do you mean names of variables, functions etc?
Any kind of artifact in code: modules, functions, classes, arguments, variables...
Re: What are some good and bad names you've encountered in Python code?
#4Do you mean names of variables, functions etc?
Yes, exactly. Thanks for the clarifying question. :-) Any kind of artifact in code: modules, functions, classes, arguments, variables...
Re: What are some good and bad names you've encountered in Python code?
#5Re: What are some good and bad names you've encountered in Python code?
#6Re: What are some good and bad names you've encountered in Python code?
#7Some good names I’ve seen are descriptive, consistent, and follow PEP 8 conventions. Some bad names I’ve seen are vague, misleading, or too long or short.
Re: What are some good and bad names you've encountered in Python code?
#8Good and bad names are a result of context.
Re: What are some good and bad names you've encountered in Python code?
#9Earlier quoted context omitted.
Yes, exactly. Thanks for the clarifying question. :-) Any kind of artifact in code: modules, functions, classes, arguments, variables...
Ones that used to annoy me were in the standard library, in particular the unitest module with camel-case functions (assertEqual and so on), I've seen this justified by it being old and predating the snake-case conventions, but surely assert_equal could have lived alongside the older names. Moot now that I've switched to pytest of course ...
Re: What are some good and bad names you've encountered in Python code?
#10Good and bad names are a result of context.
Yes, that's a great point. Some names are generally unclear, but more often, they are unclear in a context. Do you have some "contextual" examples?