On Sun, Dec 19, 2021 at 8:10 AM Ethan Furman <et...@stoneleaf.us> wrote:
>
> By way of correcting misconceptions:
>
> On 12/18/21 8:39 AM, Chris Angelico wrote:
>  >
>  > I'm not sure that this is actually possible the way you're doing it.
>  > The descriptor protocol (which is what makes properties work) won't
>  > apply when you're looking up statically.
>
> On 12/18/21 9:19 AM, Christopher Barker wrote:
>  >
>  > Anyway, the thing is that both staticmethod and property are implimented 
> using descriptors, which I think can only be
>  > invoked by instance attribute lookup. That is, the class attribute IS a 
> descriptor instance.
>
> While it is true that a descriptor does not get the chance to run its 
> `__set__` and `__delete__` methods when called on
> the class, it does get to run its `__get__` method.

Ah, thanks for clarifying that.

ChrisA
_______________________________________________
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/IGVYGUZKH3A2QBGHM4IIQGQ26TJRHTW6/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to