Unknown wrote:

> Le 19/04/2020 à 17:06, ast a écrit :
> 
> I understood where the problem is.
> 
> Once __get__ is defined, it is used to read self._name in method
> __set_name__ and it is not défined yet. That's why I have
> an error "'NoneType' object is not callable"
> Thats a nice bug.

It's the fget attribute that is None. You can verify that by setting it to 
something else:

class my_property:
    def __init__(self, fget=None, fset=None, fdel=None):
        self.fget = "fget"
        ...

> I need to think for a workaround

__get__() usually returns self if it's called on the class:

def __get__(self, instance, owner):
    if instance is None:
        return self
    ...

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to