Vincent, you should also try to avoid naming your lists a 'list'. There's a couple dozen words in Python that are reserved 'for system use':

import keyword
print(keyword.kwlist)
['False', 'None', 'True', 'and', 'as', 'assert', 'break', 'class', 'continue', 
'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from', 'global', 
'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass', 'raise', 
'return', 'try', 'while', 'with', 'yield']

'List' is actually not listed here, however, using it as a variable name is still bad:

list('spam')
['s', 'p', 'a', 'm']
list = '42'
list('spam')
Traceback (most recent call last):
File "<pyshell#26>", line 1, in <module>
list('spam')
TypeError: 'str' object is not callable

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to