I have declared the following class and declared email
as a property which is initialized with property decorators.however the __dict__
does not list email
as the property of the object rather lists _email
.
How is this working?
class abc:
def __init__(self,first,second):
self.first=first
self.second=second
self.email=first+","+second
@property
def email(self):
return self._email
@email.setter
def email(self,e):
self._email=e
a = abc("hello","world")
print(a.first)
print(a.second)
print(a.email)
print(a.__dict__)