Ivan Levkivskyi <levkivs...@gmail.com> added the comment:
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. ---------- nosy: +rhettinger _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue34498> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com