-
Notifications
You must be signed in to change notification settings - Fork 251
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
packages: make hash() consistent and incl features #370
Conversation
anticipating that <python-poetry/poetry-core#370> will remove _extras
Just a quick thought when deciding what to put into the hash for each class. In my understanding, it's not required to consider each attribute in the hash even if it is considered for equality. E.g., consider the following slightly exaggerated example:
Output: It might be inperformant, but it seems to be valid even though every instance has the same hash. Thus, I tend to say we have to decide for each attribute:
In other words, two (simplified) rules that must not be broken:
|
Split out the attribute change to #375 |
81ae512
to
a0e4c3f
Compare
a0e4c3f
to
faf9f39
Compare
faf9f39
to
40931b9
Compare
40931b9
to
f95e185
Compare
Co-authored-by: Arun Babu Neelicattu <[email protected]>
…for consistency with other properties
f95e185
to
986f175
Compare
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good to me. Someone else might need to approve.
This is a backport of 7e09102 from master (PR python-poetry#370).
Instead of relying on regular expressions, this patch leverages Python’s builtin `email.utils.parseaddr()` functionality to parse an RFC-822-compliant email address string into its name and address parts. This should also resolve issues with special characters in the name part; see for example Poetry issues python-poetry#370 and #798. python-poetry/poetry#370 python-poetry/poetry#798
No description provided.