You might have done something like this:
>>> tuple = 45, 34 # You used `tuple` as a variable here
>>> tuple
(45, 34)
>>> l = [4, 5, 6]
>>> tuple(l) # Will try to invoke the variable `tuple` rather than tuple type.
Traceback (most recent call last):
File "<pyshell#10>", line 1, in <module>
tuple(l)
TypeError: 'tuple' object is not callable
>>>
>>> del tuple # You can delete the object tuple created earlier to make it work
>>> tuple(l)
(4, 5, 6)
Here's the problem... Since you have used a tuple
variable to hold a tuple (45, 34)
earlier... So, now tuple
is an object
of type tuple
now...
It is no more a type
and hence, it is no more Callable
.
Never
use any built-in types as your variable name... You do have any other name to use. Use any arbitrary name for your variable instead...