"Don't rebind built-in names*" - it confuses readers

Steven D'Aprano steve+comp.lang.python at pearwood.info
Mon Jun 10 22:53:02 EDT 2013


On Mon, 10 Jun 2013 17:20:58 -0700, Mark Janssen wrote:

>>>         list = []
>>> Reading further, one sees that the function works with two lists, a
>>> list of file names, unfortunately called 'list',
>>
>> That is very good advice in general:  never choose a variable name that
>> is a keyword.
> 
> Btw,  shouldn't it be illegal anyway?  Most compilers don't let you do
> use a keyword as a variable name....

list is not a keyword.



-- 
Steven



More information about the Python-list mailing list