Re: Not understood error with __set_name__ in a descriptor class

2020-04-19 Thread Peter Otten
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 t

Re: Not understood error with __set_name__ in a descriptor class

2020-04-19 Thread Dieter Maurer
ast wrote at 2020-4-19 17:14 +0200: >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 bu

Re: Not understood error with __set_name__ in a descriptor class

2020-04-19 Thread ast
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. I need to think for a workaround Hel

Not understood error with __set_name__ in a descriptor class

2020-04-19 Thread ast
Hello This code is working well: (I am using python 3.6.3) class my_property: def __init__(self, fget=None, fset=None, fdel=None): self.fget = fget self.fset = fset self.fdel = fdel def __set_nam