MailingLogger 3.4.0 Released!

2011-08-17 Thread Chris Withers
I'm pleased to announce a new release of Mailinglogger. Mailinglogger provides two handlers for the standard python logging framework that enable log entries to be emailed either as the entries are logged or as a summary at the end of the running process. The handlers have the following features

Re: CGI: Assign FieldStorage values to variables

2011-08-17 Thread Gnarlodious
On Aug 17, 3:25 am, Chris Angelico wrote: > You do NOT > want end users having the power to set variables. Thanks for the warning, I can see I will need to quarantine the form input. And update() is out of the question. -- Gnarlie http://Gnarlodious.com/ -- http://mail.python.org/mailman/listinfo

Re: lists and for loops

2011-08-17 Thread alex23
On Aug 18, 1:08 pm, Emily Anne Moravec wrote: > I want to add 5 to each element of a list by using a for loop. > > Why doesn't this work? > > numbers = [1, 2, 3, 4, 5] > for n in numbers: >      n = n + 5 > print numbers As the for loop steps through numbers, it assigns each integer value to the

Re: lists and for loops

2011-08-17 Thread Jack Trades
> > I want to add 5 to each element of a list by using a for loop. > > Why doesn't this work? > > numbers = [1, 2, 3, 4, 5] > for n in numbers: > n = n + 5 > print numbers > > The n variable in the for loop refers to each value in the list, not the reference to the slot that value is stored in.

Re: Failed to create virtual environment when using --relocatable option, what's wrong?

2011-08-17 Thread alex23
On Aug 17, 12:23 am, smith jack wrote: > The environment doesn't have a file > f:\PythonEnv\djangoEnv2\Scripts\activate_thi > s.py -- please re-run virtualenv on this environment to update it Although the docs aren't very clear, --relocatable should be run on _existing_ virtualenvs. Don't think

Re: How to use python environment created using virtualenv?

2011-08-17 Thread alex23
On Aug 16, 3:15 pm, smith jack wrote: > I have created a python environment using virtualenv, but when i want > to import such environment to PyDev, error just appears, > it tells there should be a Libs dir, but there is no Libs DIr in the > virtual envronment created using virtualenv, what should

lists and for loops

2011-08-17 Thread Emily Anne Moravec
I want to add 5 to each element of a list by using a for loop. Why doesn't this work? numbers = [1, 2, 3, 4, 5] for n in numbers: n = n + 5 print numbers -- http://mail.python.org/mailman/listinfo/python-list

Re: pairwise combination of two lists

2011-08-17 Thread Gary Herron
On 08/17/2011 01:22 PM, Yingjie Lin wrote: Hi Python users, I have two lists: li1 = ['a', 'b'] li2 = ['1', '2'] and I wish to obtain a list like this li3 = ['a1', 'a2', 'b1', 'b2'] Is there a handy and efficient function to do this, especially when li1 and li2 are long lists. I found zip()

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

2011-08-17 Thread Steven D'Aprano
Seebs wrote: > On 2011-08-17, Steven D'Aprano > wrote: >> Fortunately, while we are proud of having that ability, actually *using* >> it is considered a mortal sin. We're not Ruby developers -- if you >> actually monkey-patch something, especially built-ins, you can expect to >> be taken outside

Re: pairwise combination of two lists

2011-08-17 Thread Luis M . González
This is the easiest and most pythonic way (IMHO): l3 = [i+e for i in li1 for e in li2] l3 ['a1', 'a2', 'b1', 'b2'] Regards, Luis -- http://mail.python.org/mailman/listinfo/python-list

Re: Ten rules to becoming a Python community member.

2011-08-17 Thread SigmundV
Bloody hell! This is the most persistent troll I've seen to date. He expected to get a raging army of pythoners after him, but people are just laughing at him. This is a mailing list, not a novel, so colloquialisms are welcome. The language on a mailing list should be informal and not necessarily g

Re: Wait for a keypress before continuing?

2011-08-17 Thread Chris Angelico
On Wed, Aug 17, 2011 at 7:29 PM, Steven D'Aprano wrote: > The raw_input/input UI is well-designed for entering plain text data. It is > extremely poor as a command interface. > > ... (Imagine how awkward it would be to use a TUI mail client or > text editor where the only user input was from somet

Re: pairwise combination of two lists

2011-08-17 Thread Marc Christiansen
Yingjie Lin wrote: > Hi Python users, > > I have two lists: > > li1 = ['a', 'b'] > li2 = ['1', '2'] > > and I wish to obtain a list like this > > li3 = ['a1', 'a2', 'b1', 'b2'] > > Is there a handy and efficient function to do this, especially when > li1 and li2 are long lists. Depending on

Re: pairwise combination of two lists

2011-08-17 Thread Kev Dwyer
Yingjie Lin wrote: > Hi Python users, > > I have two lists: > > li1 = ['a', 'b'] > li2 = ['1', '2'] > > and I wish to obtain a list like this > > li3 = ['a1', 'a2', 'b1', 'b2'] > > Is there a handy and efficient function to do this, especially when li1 > and li2 are long lists. > I found zip(

Re: pairwise combination of two lists

2011-08-17 Thread Ned Deily
In article <98cc6556-11f3-4850-bd2b-30481b530...@mssm.edu>, Yingjie Lin wrote: > I have two lists: > > li1 = ['a', 'b'] > li2 = ['1', '2'] > > and I wish to obtain a list like this > > li3 = ['a1', 'a2', 'b1', 'b2'] > > Is there a handy and efficient function to do this, especially when li1

Re: pairwise combination of two lists

2011-08-17 Thread Mel
Yingjie Lin wrote: > I have two lists: > > li1 = ['a', 'b'] > li2 = ['1', '2'] > > and I wish to obtain a list like this > > li3 = ['a1', 'a2', 'b1', 'b2'] > > Is there a handy and efficient function to do this, especially when li1 > and li2 are long lists. > I found zip() but it only gives [('

Re: pairwise combination of two lists

2011-08-17 Thread Mel
Mel wrote: > Yingjie Lin wrote: >> I have two lists: >> >> li1 = ['a', 'b'] >> li2 = ['1', '2'] >> >> and I wish to obtain a list like this >> >> li3 = ['a1', 'a2', 'b1', 'b2'] [ ... ] > This seems to do it : > > mwilson@tecumseth:~$ python > Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) >

pairwise combination of two lists

2011-08-17 Thread Yingjie Lin
Hi Python users, I have two lists: li1 = ['a', 'b'] li2 = ['1', '2'] and I wish to obtain a list like this li3 = ['a1', 'a2', 'b1', 'b2'] Is there a handy and efficient function to do this, especially when li1 and li2 are long lists. I found zip() but it only gives [('a', '1'), ('b', '2')],

Re: Syntactic sugar for assignment statements: one value to multiple targets?

2011-08-17 Thread Zero Piraeus
: Off on a tangent ... On 16 August 2011 20:14, gc wrote: > > Let me address one smell from my particular example, which may be the > one you're noticing. If I needed fifty parallel collections I would > not use separate variables; I've coded a ghastly defaultdefaultdict > just for this purpose,

Re: Syntactic sugar for assignment statements: one value to multiple targets?

2011-08-17 Thread Ethan Furman
gc wrote: Target lists using comma separation are great, but they don't work very well for this task. What I want is something like a,b,c,d,e = *dict() This isn't going to happen. From all the discussion so far I think your best solution is a simple helper function (not tested): def repeat

Re: Syntactic sugar for assignment statements: one value to multiple targets?

2011-08-17 Thread OKB (not okblacke)
gc wrote: > Maybe this is more visibly convenient with a complex class, like > > x, y, z = *SuperComplexClass(param1, param2, kwparam = "3", ...) > > where you need three separate objects but don't want to duplicate the > class call (for obvious copy-paste reasons) and where bundling it in a > l

Re: Wait for a keypress before continuing?

2011-08-17 Thread Steven D'Aprano
Terry Reedy wrote: > The difference is between "Hit to continue" (which we can do in > portable Python) versus "Hit any key to continue" (which we cannot, and > which also leads to the joke about people searching for the 'any' key > ;-). The equivalent contrast for GUIs is "Click OK to continue"

How to build python using visual studio 2005?

2011-08-17 Thread smith jack
anybody here have build it correctly? how to make a msi file just as the official site did? is there any detailed tutorial online? -- http://mail.python.org/mailman/listinfo/python-list

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

2011-08-17 Thread Seebs
On 2011-08-17, Ethan Furman wrote: > Part of the fun of Python is experimentation. And how much fun is it to > be told over and over, "No, you can't do that"? Okay, I buy that. Actually, this sort of fits with my experience of how (sane) people do it in Ruby. And I'm really the wrong person t

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

2011-08-17 Thread Chris Angelico
On Wed, Aug 17, 2011 at 6:38 PM, Seebs wrote: > I may have been unclear about jumping topics; that comment was about > monkey-patching, not about shadowing. > Ah, apologies. Monkey-patching is a way of using the middle of a stack of code without using what's below it. If everything is statically

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

2011-08-17 Thread Ethan Furman
Seebs wrote: On 2011-08-17, Ethan Furman wrote: Seebs wrote: On 2011-08-17, Steven D'Aprano wrote: Ah, well you see the thing is, this is Python. As soon as you call any function you don't control, you no longer know what your environment is with any certainty. For all you know, the harmless-

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

2011-08-17 Thread Seebs
On 2011-08-17, Chris Angelico wrote: > On Wed, Aug 17, 2011 at 5:33 PM, Seebs wrote: >> If it's such a bad thing, *why is it allowed*? ?Why are you proud of the >> ability to do something that you are never socially-allowed to do? > Going back to my original three examples: I may have been uncl

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

2011-08-17 Thread Chris Angelico
On Wed, Aug 17, 2011 at 5:33 PM, Seebs wrote: > If it's such a bad thing, *why is it allowed*?  Why are you proud of the > ability to do something that you are never socially-allowed to do? > Going back to my original three examples: > 1) Deliberate shadowing because you want to change the behav

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

2011-08-17 Thread Seebs
On 2011-08-17, Ethan Furman wrote: > Seebs wrote: >> On 2011-08-17, Steven D'Aprano wrote: >>> Ah, well you see the thing is, this is Python. As soon as you call any >>> function you don't control, you no longer know what your environment is >>> with any certainty. For all you know, the harmless-l

Re: Syntactic sugar for assignment statements: one value to multiple targets?

2011-08-17 Thread Chris Angelico
On Wed, Aug 17, 2011 at 5:55 PM, MRAB wrote: > x, y, z = lazy copies(SuperComplexClass(param1, etc, ...)) > This assumes that you can construct it once and then copy it reliably, which may mean that the class implement copying correctly. It also wouldn't work with: a, b, c, d = *random.randint(1

Re: Wait for a keypress before continuing?

2011-08-17 Thread Ethan Furman
Seebs wrote: Pathological narcissism is scary. If you ever find yourself going longer than usual without being wrong, start checking your work more carefully. :) +1 QOTW -- http://mail.python.org/mailman/listinfo/python-list

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

2011-08-17 Thread Ethan Furman
Seebs wrote: On 2011-08-17, Steven D'Aprano wrote: On Wed, 17 Aug 2011 01:17 pm Seebs wrote: Hmm. See, I've never reached that, in Python or any other language. I figure it creates a new potential for confusion, and that I would rather avoid any ambiguity. I don't *like* ambiguity in code.

Re: Wait for a keypress before continuing?

2011-08-17 Thread Seebs
On 2011-08-17, Terry Reedy wrote: > The difference is between "Hit to continue" (which we can do in > portable Python) versus "Hit any key to continue" (which we cannot, and > which also leads to the joke about people searching for the 'any' key > ;-). And more importantly, frustration and co

Re: Wait for a keypress before continuing?

2011-08-17 Thread Seebs
On 2011-08-17, Steven D'Aprano wrote: > I shouldn't need to say this to anyone over the age of four, but being > obnoxious to people trying to help does not encourage others to answer your > question. You don't win points for insulting people who are trying to solve > your problems. The frustrati

Re: Wait for a keypress before continuing?

2011-08-17 Thread Terry Reedy
On 8/17/2011 12:33 PM, Seebs wrote: On 2011-08-17, peter wrote: Is there an equivalent to msvcrt for Linux users? I haven't found one, and have resorted to some very clumsy code which turns off keyboard excho then reads stdin. Seems such an obvious thing to want to do I am surprised there is n

Re: Syntactic sugar for assignment statements: one value to multiple targets?

2011-08-17 Thread MRAB
On 17/08/2011 10:26, gc wrote: On Aug 17, 3:13 am, Chris Angelico wrote: Minor clarification: You don't want to initialize them to the same value, which you can do already: a=b=c=d=e=dict() Right. Call the proposed syntax the "instantiate separately for each target" operator. (It can be pr

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

2011-08-17 Thread Seebs
On 2011-08-17, Steven D'Aprano wrote: > On Wed, 17 Aug 2011 01:17 pm Seebs wrote: > [...] >> "Another" scope is normally a horizontal thing -- you're talking about >> a different scope such that you are *either* in this one *or* in that >> one. >> Built-ins are not in a scope you are never not in

Re: Wait for a keypress before continuing?

2011-08-17 Thread Seebs
On 2011-08-17, peter wrote: > Is there an equivalent to msvcrt for Linux users? I haven't found > one, and have resorted to some very clumsy code which turns off > keyboard excho then reads stdin. Seems such an obvious thing to want > to do I am surprised there is not a standard library module fo

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

2011-08-17 Thread Seebs
On 2011-08-17, Chris Angelico wrote: > def foo(list): >"""Foo's the list provided and returns True on success or False on > failure.""" > > def bar(list): > """Counts the number of bars in the list, assuming it to be made > of music.""" > if not foo(list): return > You call foo() once

Re: Wait for a keypress before continuing?

2011-08-17 Thread Steven D'Aprano
Hans Mulder wrote: > Strictly speaking, os.system is deprecated and you should use > the equivalent invocation of subprocess.call: Strictly speaking, os.system is *not* deprecated in either Python 2.x or 3.x. Latest stable documentation for Python 2.7 and 3.2: http://docs.python.org/library/os.h

Re: CGI: Assign FieldStorage values to variables

2011-08-17 Thread Chris Rebert
On Wed, Aug 17, 2011 at 2:19 AM, Gnarlodious wrote: > I should add that this does what I want, but something a little more > Pythonic? > > import cgi, os > os.environ["QUERY_STRING"] = "name1=Val1&name2=Val2&name3=Val3" > form=cgi.FieldStorage() > > form > > dict = {} > for key in form.keys(): dic

Re: Syntactic sugar for assignment statements: one value to multiple targets?

2011-08-17 Thread Terry Reedy
The issue behind this thread is that for immutable objects, binding to n copies has the same effect as n bindings to one object (so one does not really have to know which one is doing), whereas the two are different for mutable objects (so one does have to know). In short, identity matters for

Re: How to Check Write Access of a Folder on Windows

2011-08-17 Thread Tim Golden
On 16/08/2011 13:38, Ayaskant Swain wrote: Hi Tim, Thanks for your reply. It seems this issue is related to python bug -http://bugs.python.org/issue2528 But the patch code looks complex to me. I want to make changes only in my python script which will read an user given directory path& check it'

Re: monitor mouse coordinates in real-time

2011-08-17 Thread Jabba Laci
Hi, Thanks, the problem got solved. The updated version can be found at https://gist.github.com/1144708 in a comment below the original post. Solution: self.connect("destroy", self.quit) def quit(self, widget): self.mouseThread.kill() gtk.main_quit() It was not evident that quit

Some warning appears when installing virtualenv, does it matters?

2011-08-17 Thread smith jack
the warning is just as follows E:\Tools>pip install virtualenv Downloading/unpacking virtualenv Downloading virtualenv-1.6.4.tar.gz (1.9Mb): 1.9Mb downloaded Running setup.py egg_info for package virtualenv warning: no previously-included files matching '*.*' found under directory ' do

Re: Wait for a keypress before continuing?

2011-08-17 Thread Hans Mulder
On 17/08/11 10:03:00, peter wrote: Is there an equivalent to msvcrt for Linux users? I haven't found one, and have resorted to some very clumsy code which turns off keyboard excho then reads stdin. Seems such an obvious thing to want to do I am surprised there is not a standard library module fo

Re: testing if a list contains a sublist

2011-08-17 Thread Ameretat Reith
On Se shanbe 25 Mordad 1390 01:26:54 Johannes wrote: > hi list, > what is the best way to check if a given list (lets call it l1) is > totally contained in a second list (l2)? > > for example: > l1 = [1,2], l2 = [1,2,3,4,5] -> l1 is contained in l2 > l1 = [1,2,2,], l2 = [1,2,3,4,5] -> l1 is not co

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

2011-08-17 Thread Gerrat Rickert
> On 8/16/2011 7:29 PM, Terry Reedy wrote: > > On 8/16/2011 1:15 PM, Gerrat Rickert wrote: > > > I think that best practices would suggest that one shouldn't use > > variable > > names that shadow builtins (except in specific, special > circumstances), > > so I don't really think this would be an

Re: Wait for a keypress before continuing?

2011-08-17 Thread Ethan Furman
Welcome to my killfile. *plonk* -- http://mail.python.org/mailman/listinfo/python-list

Re: How to install easy_install on windows ?

2011-08-17 Thread Duncan Booth
aspineux wrote: > in a command prompt run > C:\Your Python Directory\python.exe C:\Your Download directory > \ez_setup.py > > Then use > > C:\Your Python Directory\python.exe C:\Your Python Directory\I dont > know where the easy_install script will be installed\easy_install.py > install module

Re: CGI: Assign FieldStorage values to variables

2011-08-17 Thread Nobody
On Wed, 17 Aug 2011 02:06:31 -0700, Gnarlodious wrote: > I get a construct like this: > > form=FieldStorage(None, None, [MiniFieldStorage('name1', 'Val1'), > MiniFieldStorage('name2', 'Val2'), MiniFieldStorage('name3', 'Val3')]) > > Now how would I assign every variable name* its value? Don't d

Re: How to package a gui with py2exe

2011-08-17 Thread Vlastimil Brom
2011/8/17 Benji Ara. : > Hello > I wonder how you package a Tkinter gui with py2exe? > Thanks > Benji > > > > > > -- > http://mail.python.org/mailman/listinfo/python-list > > Hi, check the necessary steps on the py2exe homepage http://www.py2exe.org/index.cgi/Tutorial in your setup script, you ha

Re: testing if a list contains a sublist

2011-08-17 Thread Nobody
On Tue, 16 Aug 2011 09:57:57 -0400, John Posner wrote: > How about using Python's core support for "==" on list objects: > for i in range(alist_sz - slist_sz + 1): > if slist == alist[i:i+slist_sz]: > return True This is bound to be asymptotically O(alist_sz * slist_sz),

Re: Windows service in production?

2011-08-17 Thread Tim Golden
On 16/08/2011 15:46, snorble wrote: Interesting. Normally I would use py2exe then do "myapp.exe -install" to install the app as a service. How do you handle installing the service? Also what does the service show under the properties, for the executable? "python.exe script.py" or something else?

Re : Messed up Mac installation

2011-08-17 Thread fmder1
Forgot to include a link : https://github.com/mxcl/homebrew -- http://mail.python.org/mailman/listinfo/python-list

Re : Messed up Mac installation

2011-08-17 Thread fmder1
Checkout Homebrew. It can install in a very easy and clean way different version of Python (as well as a lot of other stuff). It tried for a long time to keep my Mac clean and this is so far the best I found. -- http://mail.python.org/mailman/listinfo/python-list

How to package a gui with py2exe

2011-08-17 Thread Benji Ara.
Hello I wonder how you package a Tkinter gui with py2exe? Thanks Benji * * -- http://mail.python.org/mailman/listinfo/python-list

Re: Syntactic sugar for assignment statements: one value to multiple targets?

2011-08-17 Thread gc
On Aug 17, 5:45 am, Chris Angelico wrote: (snip) > > Right. Call the proposed syntax the "instantiate separately for each > > target" operator. > (snip) > It might just > as easily be some other function call; for instance: > > head1,head2,head3=file.readline() Hm--that's interesting! OK, call it

Re: CGI: Assign FieldStorage values to variables

2011-08-17 Thread Gnarlodious
I should add that this does what I want, but something a little more Pythonic? import cgi, os os.environ["QUERY_STRING"] = "name1=Val1&name2=Val2&name3=Val3" form=cgi.FieldStorage() form dict = {} for key in form.keys(): dict[ key ] = form[ key ].value dict locals().update(dict) name3 -- Gnarl

Re: Syntactic sugar for assignment statements: one value to multiple targets?

2011-08-17 Thread Chris Angelico
On Wed, Aug 17, 2011 at 10:26 AM, gc wrote: > On Aug 17, 3:13 am, Chris Angelico wrote: > >> Minor clarification: You don't want to initialize them to the same >> value, which you can do already: >> >> a=b=c=d=e=dict() > > Right. Call the proposed syntax the "instantiate separately for each > tar

Re: CGI: Assign FieldStorage values to variables

2011-08-17 Thread Chris Angelico
On Wed, Aug 17, 2011 at 10:19 AM, Gnarlodious wrote: > import cgi, os > os.environ["QUERY_STRING"] = "name1=Val1&name2=Val2&name3=Val3" > form=cgi.FieldStorage() > > form > > dict = {} > for key in form.keys(): dict[ key ] = form[ key ].value > You could probably use a list comp for this, but the

Re: Syntactic sugar for assignment statements: one value to multiple targets?

2011-08-17 Thread gc
On Aug 17, 3:13 am, Chris Angelico wrote: > Minor clarification: You don't want to initialize them to the same > value, which you can do already: > > a=b=c=d=e=dict() Right. Call the proposed syntax the "instantiate separately for each target" operator. (It can be precisely defined as a * on th

Re: CGI: Assign FieldStorage values to variables

2011-08-17 Thread Chris Angelico
On Wed, Aug 17, 2011 at 10:06 AM, Gnarlodious wrote: > I get a construct like this: > > form=FieldStorage(None, None, [MiniFieldStorage('name1', 'Val1'), > MiniFieldStorage('name2', 'Val2'), MiniFieldStorage('name3', 'Val3')]) > > when I need to assign the variable name2 the value Val2 You can pr

Re: CGI: Assign FieldStorage values to variables

2011-08-17 Thread Gnarlodious
I should add that this does what I want, but something a little more Pythonic? import cgi, os os.environ["QUERY_STRING"] = "name1=Val1&name2=Val2&name3=Val3" form=cgi.FieldStorage() form dict = {} for key in form.keys(): dict[ key ] = form[ key ].value dict locals().update(dict) name3 -- Gnarl

CGI: Assign FieldStorage values to variables

2011-08-17 Thread Gnarlodious
I get a construct like this: form=FieldStorage(None, None, [MiniFieldStorage('name1', 'Val1'), MiniFieldStorage('name2', 'Val2'), MiniFieldStorage('name3', 'Val3')]) Now how would I assign every variable name* its value? lI did try locals().update(form) however I get >>> name2 -> MiniFieldStorag

CGI: Assign FieldStorage values to variables

2011-08-17 Thread Gnarlodious
I get a construct like this: form=FieldStorage(None, None, [MiniFieldStorage('name1', 'Val1'), MiniFieldStorage('name2', 'Val2'), MiniFieldStorage('name3', 'Val3')]) Now how would I assign every variable name* its value? lI did try locals().update(form) however I get >>> name2 -> MiniFieldStorag

Re: Wait for a keypress before continuing?

2011-08-17 Thread Steven D'Aprano
On Wed, 17 Aug 2011 05:23 pm John Doe wrote: > You have every right to an opinion, Fuckturd. I shouldn't need to say this to anyone over the age of four, but being obnoxious to people trying to help does not encourage others to answer your question. You don't win points for insulting people who

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

2011-08-17 Thread Steven D'Aprano
On Wed, 17 Aug 2011 01:17 pm Seebs wrote: [...] > "Another" scope is normally a horizontal thing -- you're talking about > a different scope such that you are *either* in this one *or* in that > one. > > Built-ins are not in a scope you are never not in. That's technically incorrect. Built-ins a

Re: Wait for a keypress before continuing?

2011-08-17 Thread peter
Is there an equivalent to msvcrt for Linux users? I haven't found one, and have resorted to some very clumsy code which turns off keyboard excho then reads stdin. Seems such an obvious thing to want to do I am surprised there is not a standard library module for it. Or have I missed someting (woul

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

2011-08-17 Thread Chris Angelico
On Wed, Aug 17, 2011 at 1:58 AM, Steven D'Aprano wrote: >> My thoughts would be: >> 1.  It's hard to avoid shadowing anything unless you know the entire >> language and never forget things. > > Define the "entire language". Does that include the names of all the > plethora of exceptions? How about

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

2011-08-17 Thread Chris Angelico
On Wed, Aug 17, 2011 at 2:35 AM, Seebs wrote: > On 2011-08-17, Chris Angelico wrote: >> It mightn't be very significant, but there'd still be some cost. >> However, IMHO the greatest cost is the spamminess; forcing the user to >> deal with lines and lines of warnings is not a useful way to design

Re: Wait for a keypress before continuing?

2011-08-17 Thread John Doe
Seebs wrote: > John Doe wrote: >> Context is lost when you quote only one level. > > Not significantly. Whatever you say, Jeebs. >> I was not answering a question about my code. I was pointing >> out the fact that my questioner's terminology is >> strange/corrupt. > > Well, that's t

Re: Wait for a keypress before continuing?

2011-08-17 Thread Chris Angelico
On Wed, Aug 17, 2011 at 7:12 AM, Seebs wrote: >> Yes, even the common term "command line" is foreign to me. I do >> some powerful stuff in Windows, without need for a command line. > > So apparently you *do* know the term.  Normally, to say that a term is > foreign to you is to say that you have n

Re: Syntactic sugar for assignment statements: one value to multiple targets?

2011-08-17 Thread Chris Angelico
On Wed, Aug 17, 2011 at 1:14 AM, gc wrote: > Perfectly reasonable request! Maybe there aren't as many cases when > multiple variables need to be initialized to the same value as I think > there are. > Minor clarification: You don't want to initialize them to the same value, which you can do alrea