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.

Author kj
Recipients gvanrossum, kj
Date 2021-02-13.04:41:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1613191303.57.0.697063062822.issue41559@roundup.psfhosted.org>
In-reply-to
Content
Hi Guido, after a month of observing how people stumbled over the related collections.abc.Callable bugs, and experience from implementing this PEP, I learnt a few things which I think may interest you:

Previously it was *recommended* that everything in typing be hashable. I would now say it is *required*. Union uses sets to de-duplicate arguments, and Optional uses Union internally. Both blow up if things aren't hashable. A surprising number of people caught the collections.abc.Callable bug because Optional[Callable[.....]] failed.

Going forward, future PEPs to typing.py probably need to ensure their implementations are hashable, or risk not working with some of the types in the module itself. Alternatively, they can always change the implementations of Union and Optional, though I don't know if I recommend that ;).

Thanks for your time.
History
Date User Action Args
2021-02-13 04:41:43kjsetrecipients: + kj, gvanrossum
2021-02-13 04:41:43kjsetmessageid: <1613191303.57.0.697063062822.issue41559@roundup.psfhosted.org>
2021-02-13 04:41:43kjlinkissue41559 messages
2021-02-13 04:41:43kjcreate