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


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

Re: Why no warnings when re-assigning builtin names?

Started byEthan Furman <ethan@stoneleaf.us>
First post2011-08-15 15:34 -0700
Last post2011-08-15 16:12 -0700
Articles 3 — 2 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: Why no warnings when re-assigning builtin names? Ethan Furman <ethan@stoneleaf.us> - 2011-08-15 15:34 -0700
    Re: Why no warnings when re-assigning builtin names? Seebs <usenet-nospam@seebs.net> - 2011-08-15 22:33 +0000
      Re: Why no warnings when re-assigning builtin names? Ethan Furman <ethan@stoneleaf.us> - 2011-08-15 16:12 -0700

#11477 — Re: Why no warnings when re-assigning builtin names?

FromEthan Furman <ethan@stoneleaf.us>
Date2011-08-15 15:34 -0700
SubjectRe: Why no warnings when re-assigning builtin names?
Message-ID<mailman.23.1313446657.27778.python-list@python.org>
Gerrat Rickert wrote:
> What sayest the Python community about having an explicit warning 
> against such un-pythonic behaviour (re-assigning builtin names)?

What makes you think this behavior is unpythonic?  Python is not about 
hand-holding.

~Ethan~

[toc] | [next] | [standalone]


#11478

FromSeebs <usenet-nospam@seebs.net>
Date2011-08-15 22:33 +0000
Message-ID<slrnj4j7lj.i7e.usenet-nospam@guild.seebs.net>
In reply to#11477
On 2011-08-15, Ethan Furman <ethan@stoneleaf.us> wrote:
> Gerrat Rickert wrote:
>> What sayest the Python community about having an explicit warning 
>> against such un-pythonic behaviour (re-assigning builtin names)?

> What makes you think this behavior is unpythonic?  Python is not about 
> hand-holding.

It seems like something which is sufficiently likely to be a mistake might
deserve a warning -- especially since, so far as I can tell, there's never
going to be a program which can't easily be written to avoid the problematic
behavior.

-s
-- 
Copyright 2011, all wrongs reversed.  Peter Seebach / usenet-nospam@seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
I am not speaking for my employer, although they do rent some of my opinions.

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


#11479

FromEthan Furman <ethan@stoneleaf.us>
Date2011-08-15 16:12 -0700
Message-ID<mailman.25.1313448950.27778.python-list@python.org>
In reply to#11478
Seebs wrote:
> On 2011-08-15, Ethan Furman <ethan@stoneleaf.us> wrote:
>> Gerrat Rickert wrote:
>>> What sayest the Python community about having an explicit warning 
>>> against such un-pythonic behaviour (re-assigning builtin names)?
> 
>> What makes you think this behavior is unpythonic?  Python is not about 
>> hand-holding.
> 
> It seems like something which is sufficiently likely to be a mistake might
> deserve a warning -- especially since, so far as I can tell, there's never
> going to be a program which can't easily be written to avoid the problematic
> behavior.

"sufficiently likely" depends entirely on who is doing the coding.  I 
use `open()` for opening my files, and so regularly use `file` as a 
name.  It can also be very handy to mask a built-in when doing something 
even more fun and entertaining and I, for one, have zero desire to have 
Python start warning me about perfectly legitimate code.

Programmers need to learn whichever language they are choosing to code 
in, and if extra help is needed beyond whatever is basic for that 
language, find (or write! ;) the third-party tool to help out.  There 
are at least two linters for Python, and multiple IDEs that can help 
with these, and other, problems.  (I don't much care for IDEs, but I am 
thinking of starting to use a linter, myself.)

~Ethan~

[toc] | [prev] | [standalone]


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


csiph-web