moar confuse()
>>> class Foo:
... def __init__(self, start):
... self.__bar = start
... def bar(self):
... return self.__bar
... def setBar(self, neo):
... self.__bar = neo
...
>>> f = Foo(42)
>>> f.bar()
42
>>> f.__bar
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: Foo instance has no attribute '__bar'
>>> f.__bar = "ougaouga"
>>> f.__bar
'ougaouga'
>>> f.bar()
42
>>> f.setBar(1337)
>>> f.__bar
'ougaouga'
>>> f.bar()
1337
>>> f.__bar = "wtf"
>>> f.bar()
1337Posted in prog | aucun comments |
confuse me harder plz
Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
> f = function()
>> x = 42
>> return nil
>> end
>
> x = nil
> print(x)
nil
>
> x, y = f(), x
> print(x)
nil
> print(y)
42C’est faisable (en un peu moins sexy à écrire) python ou ruby également. sayfun !
Posted in prog | aucun comments |
augmente ta zic
http://www.youtube.com/watch?v=DGx-5A3onb0
Le clip d’un ami qui démarre, faites tourner :D
Posted in blabla | aucun comments |