faulkner a écrit :
(please, don't top-post - corrected)
>
> Miguel Galves wrote:
>
>>Hello,
>>
>>I`m starting to learn python, and I hava a very good background in Java
>>and C/C++ programming. I was reading Dive into python chapter about
>>OO and I saw that in python we can do the following:
>>
when you set an attribute of an object, python secretly calls that
objects __setattr__ method.
class test:
def __setattr__(self, attr_name, attr_value):
print self, attr_name, attr_value
self.__dict__[attr_name] = attr_value# do what the original
__setattr__ method does.
tes
Hello,I`m starting to learn python, and I hava a very good background in Javaand C/C++ programming. I was reading Dive into python chapter aboutOO and I saw that in python we can do the following:class Person:
passjoe = new Person()joe.name = "Joe"joe.age = 13It seems that it is possible to add