This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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) * (Python committer) 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) * (Python committer) 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) * (Python committer) 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) * (Python committer) 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) * (Python committer) Date: 2015-05-14 13:20
Oh, great! Thank you.
History
Date User Action Args
2022-04-11 14:58:16adminsetgithub: 68376
2015-05-14 13:20:39pitrousetstatus: open -> closed
resolution: out of date
messages: + msg243190

stage: resolved
2015-05-14 13:20:04Yury.Selivanovsetnosy: + Yury.Selivanov
messages: + msg243189
2015-05-14 10:24:53pitrousetmessages: + msg243172
2015-05-14 10:23:52pitrousetmessages: + msg243171
2015-05-14 10:22:19serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg243169
2015-05-14 09:35:04pitroucreate