improve pkg_resources.Distribution.hashcmp performance#2090
Conversation
by storing location without md5
|
As the fix is not supposed to change any semantics, I wonder which sort of tests should be added. |
instead of `property(getter, setter)` Co-authored-by: Nguyễn Gia Phong <mcsinyx@disroot.org>
|
Although this approach achieves the desired result (only calculate _location_without_md5 once), it causes quite a bit of entanglement with the |
|
I make |
|
That's fair, and I had the same concern. After inspecting the code, it appears it's only ever set once during the constructor. I'd hate to add code that explicitly adds support for setting the value later when it will only ever be set once during construction. I'll go with #2098 until a use-case demands a setter. Thanks for the contrib! |
|
I think more important than before accepting either PR will be to define a problem that needs to be solved, so I'll await an answer in #2089 |
|
I prefer #2108. Thanks again for the contrib. |
|
It is always better to remove code when possible. |
by storing location without md5.
Turns
Distribution.locationinto a property to makehashcmpmore performant.Closes #2089
Pull Request Checklist