Miojo
(usa Fedora)
Enviado em 25/02/2010 - 21:31h
>>> class MyClass():
... $$$ def __init__(self):
... $$$$$$$ self.foo = None
... $$$ def setFoo(self, foo):
... $$$$$$$ self.foo = foo
... $$$ def setFooNone(self):
... $$$$$$$ self.foo = None
...
>>> foobar = MyClass()
>>> print foobar.foo
None
>>> foo.setFoo('Hello World!')
>>> print foobar.foo
'Hello World!'
>>> foo.setFooNone()
>>> print foobar.foo
None
>>> import sys
>>> sys.exit(0)