-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unnecessary underscore suffix for many arguments and attributes #234
Comments
Thanks, @wbolster . This is something I'd like to consider the next time we do a major refactoring of the library (perhaps for the next major release of the language). I was initially opposed to having attributes with the same name as Python builtins (particularly ones that actually get used in the same code, such as I'm curious to hear what other people think. Does anyone know of examples (popular Python libraries) where the "trailing _" strategy is vs. is not used? Regardless, I don't think we'll want to change it until a major release. The backward compatibility issues would be enormous. |
My initial confusion was caused by mentally substituting "built-in" for "keyword" in PEP8.
I'll take the blame 100% for this. |
Thanks. Trailing underscores are a necessary evil for things like That said, do you have any other "big picture" ideas for a future version? |
Re. example code: all Pythonic code has nice APIs of course! :) For example, it's very common to have a |
Thanks, @wbolster. My other long-term goals are primarily to get rid of the "bindings" ( |
Have you considered PyXB instead of generateDS? |
In the mean time, it would be nice if you could document (maybe just a README in the |
@wbolster, we looked at PyXB when we started python-cybox development and unfortunately it wasn't able to process the CybOX schemas, so we went with generateDS. |
In Python,
id
is not a reserved word (it is the name of a built-in function though), so there is no reason to useid_
for function arguments and attribute names. It only clutters the API.The same applies to
type
andobject
.The text was updated successfully, but these errors were encountered: