Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #11479
| Date | 2011-08-15 16:12 -0700 |
|---|---|
| From | Ethan Furman <ethan@stoneleaf.us> |
| Subject | Re: Why no warnings when re-assigning builtin names? |
| References | <BB13E4C4D649234F84A01F6DF64BB87F076AD0CE@ccs-ex01.coldstorage.com> <mailman.23.1313446657.27778.python-list@python.org> <slrnj4j7lj.i7e.usenet-nospam@guild.seebs.net> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.25.1313448950.27778.python-list@python.org> (permalink) |
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~
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
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
csiph-web