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 levkivskyi
Recipients Dutcho, enedil, gvanrossum, levkivskyi, rhettinger
Date 2018-08-25.17:30:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1535218257.25.0.56676864532.issue34498@psf.upfronthosting.co.za>
In-reply-to
Content
This is why we have 4 months of betas :-)

On one hand making objects in `typing` module not classes was intentional, but on another hand this use case looks totally fine.

I would say we could update the check in `functools` to accept more things. I am however not sure what to allow here in addition to proper classes, maybe just anything that overrides `__subclasscheck__` and/or `__instancecheck__`? I could imagine there might be some other objects that implement custom instance and class checks beyond `typing` that are rejected by current checks in `functools`.

As a temporary workaround you can use `collections.abc.Sequence`, this type is aliased by `typing.Sequence`, in fact all instance checks etc. are relayed to the former.
History
Date User Action Args
2018-08-25 17:30:57levkivskyisetrecipients: + levkivskyi, gvanrossum, rhettinger, Dutcho, enedil
2018-08-25 17:30:57levkivskyisetmessageid: <1535218257.25.0.56676864532.issue34498@psf.upfronthosting.co.za>
2018-08-25 17:30:57levkivskyilinkissue34498 messages
2018-08-25 17:30:57levkivskyicreate