Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #47623 > unrolled thread

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

Started byMark Janssen <dreamingforward@gmail.com>
First post2013-06-10 17:20 -0700
Last post2013-06-11 16:23 +0000
Articles 3 — 3 participants

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: "Don't rebind built-in names*" - it confuses readers Mark Janssen <dreamingforward@gmail.com> - 2013-06-10 17:20 -0700
    Re: "Don't rebind built-in names*" - it confuses readers Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-11 02:53 +0000
    Re: "Don't rebind built-in names*" - it confuses readers Grant Edwards <invalid@invalid.invalid> - 2013-06-11 16:23 +0000

#47623 — Re: "Don't rebind built-in names*" - it confuses readers

FromMark Janssen <dreamingforward@gmail.com>
Date2013-06-10 17:20 -0700
SubjectRe: "Don't rebind built-in names*" - it confuses readers
Message-ID<mailman.3002.1370910429.3114.python-list@python.org>
>>         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....

-- 
MarkJ
Tacoma, Washington

[toc] | [next] | [standalone]


#47631

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2013-06-11 02:53 +0000
Message-ID<51b6910d$0$29997$c3e8da3$5496439d@news.astraweb.com>
In reply to#47623
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

[toc] | [prev] | [next] | [standalone]


#47672

FromGrant Edwards <invalid@invalid.invalid>
Date2013-06-11 16:23 +0000
Message-ID<kp7iua$d74$1@reader1.panix.com>
In reply to#47623
On 2013-06-11, Mark Janssen <dreamingforward@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            

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web