I am running the following code in Jupyter:
from typing import List
class dummy:
def __init__(self, dum: List =[]):
self.dum = dum
@property
def dum(self) -> List:
return self.dum
@dum.setter
def dum(self, value: List) -> None:
self.dum = value
When I run the following:
dummy(dum=[1,2,3])
The kernel dies without telling me much about the possible error. What is going on?
dum
is at the same time a method and an attribute, sodummy().dum
is confusing. Renaming the attribute should solve the issue.self.dum = value
,RecursionError: maximum recursion depth exceeded
.