Hey Chris,

thanks for the response. Right, the metaclass approach should work because then 
type(ANY) returns AnyMeta. Still, I find it a bit unintuitive that 
`classmethod` does not work and that one needs to either write two classes to 
achieve this behaviour, or to create an instance of a class.

> Under what circumstances do you actually want the same handler for both the 
> class and its instances? Seems unusual.

Well, I think the main application are non-instantiable classes such as `None`, 
things like `typing.Any` or the example `ANY` here. Since the only purpose of 
this class is to equality compare to `True`, it doesn't really make sense to 
allow instances of this class.

Disclaimer: my background is mathematics and not computer science so apologies 
if I am talking non-sense here....
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/SR62J5HGQHUSF3YF235N7VM3GKRT35UZ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to