Use of implementation specific behaviour in cases where it could be avoided #12610
Open
2 tasks done
Labels
source::community
catch-all for issues filed by community members
type::bug
describes erroneous operation, use severity::* to classify the type
Checklist
What happened?
There are several cases within the conda program where conda relies on implementation-specific behaviour, and in most of these cases it could be easily avoided with virtually no performance cost.
The implementation-specific behaviour in question is dunders (double-underscored names or attributes). The relevant part of the Python3 documentation states
There are some cases where the use of these dunders is justified, (i.e., an alternative implementation would be much less performant), but in most instances of dunder use this is simply not the case. For example,
obj.__class__
is used wheretype(obj)
could be used instead. Another common example that I've noticed isobj.__dict__
, wherevars(object)
could be used instead. Because dunders are technically implementation defined, there could exist Python implementations which don't support the usage of certain dunders in certain ways, and therefore dunders should be avoided whenever the cost of doing so is negligible (as it is in the examples I have given).If it's alright, I'll start work on a PR which replaces the use of dunders (where the cost is negligible). If you have any questions, comments, or concerns, please let me know and I'll get back to you as soon as I can.
Conda Info
No response
Conda Config
No response
Conda list
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: