"Don't rebind built-in names*" - it confuses readers
Grant Edwards
invalid at invalid.invalid
Tue Jun 11 12:23:38 EDT 2013
On 2013-06-11, Mark Janssen <dreamingforward at gmail.com> 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....
We're not talking about keywords. We're talking about built-ins --
which are just global symbols that are pre-imported for your shopping
convenience. Other than the fact that they're pre-imported for you,
they're no different than symbols imported from any other module.
--
Grant Edwards grant.b.edwards Yow! Could I have a drug
at overdose?
gmail.com
More information about the Python-list
mailing list