Issue 24188: Signature objects not hashable (original) (raw)
This issue has been migrated to GitHub: https://github.com/python/cpython/issues/68376
classification
Title: | Signature objects not hashable | ||
---|---|---|---|
Type: | enhancement | Stage: | resolved |
Components: | Library (Lib) | Versions: | Python 3.5 |
process
Status: | closed | Resolution: | out of date |
---|---|---|---|
Dependencies: | Superseder: | ||
Assigned To: | Nosy List: | Yury.Selivanov, pitrou, serhiy.storchaka, yselivanov | |
Priority: | normal | Keywords: |
Created on 2015-05-14 09:35 by pitrou, last changed 2022-04-11 14:58 by admin. This issue is now closed.
Messages (6) | ||
---|---|---|
msg243164 - (view) | Author: Antoine Pitrou (pitrou) * ![]() |
Date: 2015-05-14 09:35 |
inspect.Signature objects are immutable, but they are not hashable. It would be useful if they were. (I would have a similar request for bound arguments but unfortunately their mutability may make it less desirable) | ||
msg243169 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2015-05-14 10:22 |
([],) is immutable, but is not hashable. If default values affect the hash, the signature can't be always hashable. | ||
msg243171 - (view) | Author: Antoine Pitrou (pitrou) * ![]() |
Date: 2015-05-14 10:23 |
But that kind of makes my point. While ([],) is not hashable, other tuples are hashable. | ||
msg243172 - (view) | Author: Antoine Pitrou (pitrou) * ![]() |
Date: 2015-05-14 10:24 |
Also, a workaround would be to id() the defaults when hashing. | ||
msg243189 - (view) | Author: Yury Selivanov (Yury.Selivanov) * | Date: 2015-05-14 13:20 |
Signatures and Parameters are already hash able in 3.5. Please close the issue. | ||
msg243190 - (view) | Author: Antoine Pitrou (pitrou) * ![]() |
Date: 2015-05-14 13:20 |
Oh, great! Thank you. |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-04-11 14:58:16 | admin | set | github: 68376 |
2015-05-14 13:20:39 | pitrou | set | status: open -> closedresolution: out of datemessages: + stage: resolved |
2015-05-14 13:20:04 | Yury.Selivanov | set | nosy: + Yury.Selivanovmessages: + |
2015-05-14 10:24:53 | pitrou | set | messages: + |
2015-05-14 10:23:52 | pitrou | set | messages: + |
2015-05-14 10:22:19 | serhiy.storchaka | set | nosy: + serhiy.storchakamessages: + |
2015-05-14 09:35:04 | pitrou | create |