Home

I'm confused about why i get a type error when i call an object's
method. Here's the example code:
>>> class Foo:
def __init__(self):
self.foo = []
def foo(self):
print "in foo!"


>>> f = Foo()
>>> dir(f)
['__doc__', '__init__', '__module__', 'foo']
>>> f.foo()

Traceback (most recent call last):
File "<pyshell#32>", line 1, in <module>
f.foo()
TypeError: 'list' object is not callable
>>>

previous
next

Re: What sort of C++ skills are needed for a proprietary trader?
Re: C/C++ guidelines
Re: Protected member friend
Re: Real time plot
Re: Modul (%) in python not like in C?
Mam Marzenie
Akogo
Niechciane i Zapomniane
Podaruj Zycie
Nasze Dzieci