$ python
Python 2.7.2+ (default, Oct 4 2011, 20:03:08)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> class A(object):
... def __init__(self): self.__sarlanga = 1
... def s(self): return self.__sarlanga
...
>>> B = A
>>> B
>>> class A(B):
... def __init__(self):
... B.__init__(self)
... self.__sarlanga = 2
...
>>> aa = A()
>>> aa.s()
2
>>> class C(B):
... def __init__(self):
... B.__init__(self)
... self.__sarlanga = 3
...
>>> c = C()
>>> c.s()
1
Happy hacking,
Aure.
No hay comentarios.:
Publicar un comentario