[Tutor] Class Property ?

Sean 'Shaleh' Perry shalehperry@attbi.com
Wed, 28 Aug 2002 14:19:56 -0700


On Wednesday 28 August 2002 14:06, runsun wrote:
> Could someone tell me what the difference is between the following 2 ??
>
> [1]
>
> class test:
>   def __init__(self):
>     self.__dict__['LastName']=3D""            <=3D=3D=3D=3D=3D
>
> [2]
>
> class test:
>   def __init__(self):
>     self.LastName=3D""                      <=3D=3D=3D=3D=3D=3D
>

[2] causes the interpeter to perform [1].  If the class defines a __setat=
tr__=20
[2] can lead to infinite loops.