WSME 0.3 released

2012-04-20 Thread Christophe de Vienne
About WSME -- WSME (Web Service Made Easy) is a very easy way to implement webservices in your python web application (or standalone). Main Changes * Introduce a sphinx extension to easily document your api. More details on http://packages.python.org/WSME/changes.html.

ANN: sqlparse 0.1.4

2012-04-20 Thread Andi Albrecht
I'm pleased to announce sqlparse 0.1.4. This is a bug fix release. sqlparse is a non-validating SQL parser module for Python. Download:http://pypi.python.org/pypi/sqlparse/0.1.4 Development: https://github.com/andialbrecht/sqlparse Online demo: http://sqlformat.appspot.com Bug fixes in this

Re: can I overload operators like =, - or something like that?

2012-04-20 Thread Ben Finney
alex23 wuwe...@gmail.com writes: On Apr 20, 5:54 am, Jacob MacDonald jaccar...@gmail.com wrote: On Thursday, April 19, 2012 12:28:50 PM UTC-7, dmitrey wrote: can I somehow overload operators like =, - or something like that? I don't believe that you could overload those particular

Re: How do you refer to an iterator in docs?

2012-04-20 Thread Steven D'Aprano
I refer you to your subject line: How do you refer to an iterator in docs? In documentation, I refer to an iterator as an iterator, just as I would refer to a list as a list, a dict as a dict, or a string as a string. You may also find these useful: sequence something that obeys the

Difference between 'imp' and 'importlib'

2012-04-20 Thread Frank Millman
Hi all I need the ability to execute a function by parsing a string containing the full path to the function. The string is multi-dotted. The last element is the function name, the second-last is the name of the module containing the function, and the balance is the path to the module. I have

Re: Framework for a beginner

2012-04-20 Thread Bryan
Gerd Niemetz wrote: Take a look at http://www.web2py.com, a powerful and easy to learn python framework, and the community at https://groups.google.com/forum/?fromgroups#!forum/web2py is also very helpful Web2py rocks. It does by default better than many, probably most, professional web

Re: os.system()

2012-04-20 Thread Yigit Turgut
On Apr 19, 11:02 pm, Steve n...@spam.com wrote: Yigit Turgut  wrote in message news:b9a8bb28-3003-4a36-86fb-339ef697b...@i2g2000vbd.googlegroups.com... When I use os.system() function, script waits for termination of the windows that is opened by os.system() to continue thus throwing errors

Re: os.system()

2012-04-20 Thread Chris Angelico
On Fri, Apr 20, 2012 at 8:51 PM, Yigit Turgut y.tur...@gmail.com wrote: On Apr 19, 11:02 pm, Steve n...@spam.com wrote: Yigit Turgut  wrote in message news:b9a8bb28-3003-4a36-86fb-339ef697b...@i2g2000vbd.googlegroups.com... When I use os.system() function, script waits for termination of the

code blocks in Python 2 and 3

2012-04-20 Thread Kiuhnm
Read about it here: http://mtomassoli.wordpress.com/2012/04/20/code-blocks-in-python/ or just download the module from here: https://bitbucket.org/mtomassoli/codeblocks/ The module codeblocks (codeblocks.py) includes a detailed docstring. Kiuhnm --

Pexpect support with Python3.2.3

2012-04-20 Thread Girish bist
Hi - I am using the pexpect version 2.4 with Python-3.2.3. I have written a small script to verify the pexpect support with Python 3.2.3. This script times out during the system call select execution. Can anyone please help us with the issue here. The same script is working fine with Python 2.7.3

Re: How do you refer to an iterator in docs?

2012-04-20 Thread Jean-Michel Pichavant
Jon Clements wrote: On Thursday, 19 April 2012 13:21:20 UTC+1, Roy Smith wrote: Let's say I have a function which takes a list of words. I might write the docstring for it something like: def foo(words): Foo-ify words (which must be a list) What if I want words to be the more general

Problem with running python cgi scripts through my browser

2012-04-20 Thread kreta06
Dear Python Tutors, I am having problems trying to send an email (using the smtplib module ) to send an email to myself over my browser using a python script, which is being called by an html form that I have created. My python cgi script is located in my cgi-bin directory, which I had made sure

Python interface of Stanford Parser

2012-04-20 Thread ac27037
Dear Experts, Does anybody know how to use the Stanford Parser for Python Interface? I have tried many times, and don't know how to install and use. In fact, I have failed at that many times. Here is the interface: http://projects.csail.mit.edu/spatial/Stanford_Parser  Thank you! Sincerely,

setup.py

2012-04-20 Thread alister ware
What is the correct way to set the version of my package with distutils when i build it using python setup.py bdist_rpm I have __version__=x.x.x in my main programm but if i add from prog import __version__ into setup.py if fails when my prog tries to import gi.repository. I suspect my

Python exercise club

2012-04-20 Thread kreta06
Hi Python Programmers or Newbies, I have just started a small group of python programmers (newbies and people with intermediate python programming experience) to develop and work weekly on a series of python exercises and come up with solutions to these exercises I develop. The aim is to improve

Re: How do you refer to an iterator in docs?

2012-04-20 Thread Roy Smith
In article 4f910c3d$0$29965$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: I refer you to your subject line: How do you refer to an iterator in docs? In documentation, I refer to an iterator as an iterator, just as I would refer to a list

Re: Is there *any* real documentation to PyWin32?

2012-04-20 Thread kvam...@gmail.com
That's pretty unfair. If you know the Windows API, then the documentation is sufficient. If you need to learn the API, then it's unreasonable to expect Mark Hammond, et. al. to bundle the amount of material needed along with the software. The book is an excellent introduction to the Windows

Re: Python interface of Stanford Parser

2012-04-20 Thread Stefan Behnel
ac27037, 20.04.2012 15:19: Does anybody know how to use the Stanford Parser for Python Interface? I have tried many times, and don't know how to install and use. In fact, I have failed at that many times. Here is the interface: http://projects.csail.mit.edu/spatial/Stanford_Parser It

Re: can I overload operators like =, - or something like that?

2012-04-20 Thread Jacob MacDonald
On Thursday, April 19, 2012 11:09:52 PM UTC-7, Ben Finney wrote: alex23 wuwe...@gmail.com writes: On Apr 20, 5:54 am, Jacob MacDonald jaccar...@gmail.com wrote: On Thursday, April 19, 2012 12:28:50 PM UTC-7, dmitrey wrote: can I somehow overload operators like =, - or something like

Re: How do you refer to an iterator in docs?

2012-04-20 Thread Jacob MacDonald
On Friday, April 20, 2012 6:41:25 AM UTC-7, Roy Smith wrote: In article 4f910c3d$0$29965$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: I refer you to your subject line: How do you refer to an iterator in docs? In documentation, I

Re: can I overload operators like =, - or something like that?

2012-04-20 Thread Nobody
On Thu, 19 Apr 2012 12:28:50 -0700, dmitrey wrote: can I somehow overload operators like =, - or something like that? (I'm searching for appropriate overload for logical implication if a then b) You cannot create new operators, but you can control how existing operators work on types which

Using arguments in a decorator

2012-04-20 Thread Rotwang
Hi all, here's a problem I don't know how to solve. I'm using Python 2.7.2. I'm doing some stuff in Python which means I have cause to call functions that take a while to return. Since I often want to call such a function more than once with the same arguments, I've written a decorator to

Re: Using arguments in a decorator

2012-04-20 Thread Jon Clements
On Friday, 20 April 2012 16:57:06 UTC+1, Rotwang wrote: Hi all, here's a problem I don't know how to solve. I'm using Python 2.7.2. I'm doing some stuff in Python which means I have cause to call functions that take a while to return. Since I often want to call such a function more than

Re: can I overload operators like =, - or something like that?

2012-04-20 Thread Kiuhnm
On 4/20/2012 17:50, Nobody wrote: On Thu, 19 Apr 2012 12:28:50 -0700, dmitrey wrote: can I somehow overload operators like =, - or something like that? (I'm searching for appropriate overload for logical implication if a then b) You cannot create new operators, but you can control how

Re: Using arguments in a decorator

2012-04-20 Thread Peter Otten
Rotwang wrote: I've written a decorator to eliminate repeated calls by storing a dictionary whose items are arguments and their results: The problem is that the dictionary key stored depends on how the function was called, even if two calls should be equivalent; hence the original function

Re: can I overload operators like =, - or something like that?

2012-04-20 Thread Tim Chase
On 04/20/12 11:45, Kiuhnm wrote: IOW, you can't define - or =, but you could define= or . You can also overload '-' ;) Oooh, that's evil. Slick, but evil! :-D -tkc -- http://mail.python.org/mailman/listinfo/python-list

Re: Suggest design to accomodate non-unix platforms ?

2012-04-20 Thread Dan Stromberg
On Thu, Apr 19, 2012 at 5:14 PM, Chris Angelico ros...@gmail.com wrote: The question then is whether to choose or auto-detect. Attempting to auto-detect could be quite inefficient; imagine if you have to call on ssh every couple of seconds, and something in $PATH is on a slow network share

Re: can I overload operators like =, - or something like that?

2012-04-20 Thread Jussi Piitulainen
Kiuhnm writes: On 4/20/2012 17:50, Nobody wrote: On Thu, 19 Apr 2012 12:28:50 -0700, dmitrey wrote: can I somehow overload operators like =, - or something like that? (I'm searching for appropriate overload for logical implication if a then b) You cannot create new operators, but

Re: can I overload operators like =, - or something like that?

2012-04-20 Thread Peter Otten
Kiuhnm wrote: You can also overload '-' ;) In the same spirit: http://code.activestate.com/recipes/384122-infix-operators/ -- http://mail.python.org/mailman/listinfo/python-list

Re: can I overload operators like =, - or something like that?

2012-04-20 Thread Kiuhnm
On 4/20/2012 19:49, Jussi Piitulainen wrote: Kiuhnm writes: On 4/20/2012 17:50, Nobody wrote: On Thu, 19 Apr 2012 12:28:50 -0700, dmitrey wrote: can I somehow overload operators like =, - or something like that? (I'm searching for appropriate overload for logical implication if a then b)

Re: Suggest design to accomodate non-unix platforms ?

2012-04-20 Thread Chris Angelico
On Sat, Apr 21, 2012 at 3:44 AM, Dan Stromberg drsali...@gmail.com wrote: On Thu, Apr 19, 2012 at 5:14 PM, Chris Angelico ros...@gmail.com wrote: The question then is whether to choose or auto-detect. Attempting to auto-detect could be quite inefficient; imagine if you have to call on ssh

Re: can I overload operators like =, - or something like that?

2012-04-20 Thread Chris Angelico
On Sat, Apr 21, 2012 at 4:21 AM, Kiuhnm kiuhnm03.4t.yahoo...@mail.python.org wrote: Another option is to rely on ugly pseudo-operators:  a .imp. b  a .imp (b .imp. c) Or functions: implies(a,b) implies(a,implies(b,c)) That's the simplest option :) No hacks required, syntax is clear even if

Re: os.system()

2012-04-20 Thread Adam Skutt
On Apr 20, 6:51 am, Yigit Turgut y.tur...@gmail.com wrote: On Apr 19, 11:02 pm, Steve n...@spam.com wrote: Yigit Turgut wrote in message news:b9a8bb28-3003-4a36-86fb-339ef697b...@i2g2000vbd.googlegroups.com... When I use os.system() function, script waits for termination of the

why () is () and [] is [] work in other way?

2012-04-20 Thread dmitrey
I have spent some time searching for a bug in my code, it was due to different work of is with () and []: () is () True [] is [] False (Python 2.7.2+ (default, Oct 4 2011, 20:03:08) [GCC 4.6.1] ) Is this what it should be or maybe yielding unified result is better? D. --

Re: why () is () and [] is [] work in other way?

2012-04-20 Thread Chris Angelico
On Sat, Apr 21, 2012 at 5:10 AM, dmitrey dmitre...@gmail.com wrote: I have spent some time searching for a bug in my code, it was due to different work of is with () and []: () is () True [] is [] False Okay, let's take a step back. What do you expect is to be doing? It doesn't check for

Re: why () is () and [] is [] work in other way?

2012-04-20 Thread Robert Kern
On 4/20/12 8:10 PM, dmitrey wrote: I have spent some time searching for a bug in my code, it was due to different work of is with () and []: () is () True The empty tuple is unique, immutable, and common so the Python runtime optimizes this by reusing the same object, much like small

Re: why () is () and [] is [] work in other way?

2012-04-20 Thread Rotwang
On 20/04/2012 20:10, dmitrey wrote: I have spent some time searching for a bug in my code, it was due to different work of is with () and []: () is () True [] is [] False (Python 2.7.2+ (default, Oct 4 2011, 20:03:08) [GCC 4.6.1] ) Is this what it should be or maybe yielding unified

Re: why () is () and [] is [] work in other way?

2012-04-20 Thread Alain Ketterlin
dmitrey dmitre...@gmail.com writes: I have spent some time searching for a bug in my code, it was due to different work of is with () and []: () is () True [] is [] False (Python 2.7.2+ (default, Oct 4 2011, 20:03:08) [GCC 4.6.1] ) Is this what it should be or maybe yielding unified

Appending to []

2012-04-20 Thread Jan Sipke
Can you explain why there is a difference between the following two statements? a = [] a.append(1) print a [1] print [].append(1) None Best regards, Jan Sipke -- http://mail.python.org/mailman/listinfo/python-list

Re: Appending to []

2012-04-20 Thread Chris Angelico
On Sat, Apr 21, 2012 at 6:03 AM, Jan Sipke jansi...@gmail.com wrote: Can you explain why there is a difference between the following two statements? a = [] a.append(1) print a [1] This looks at the list after appending. print [].append(1) None This looks at the return value of the

Re: Appending to []

2012-04-20 Thread Rotwang
On 20/04/2012 21:03, Jan Sipke wrote: Can you explain why there is a difference between the following two statements? a = [] a.append(1) print a [1] print [].append(1) None append is a method of the list object []. Methods, in general, both do something to the objects of which they are

Re: Appending to []

2012-04-20 Thread Kiuhnm
On 4/20/2012 22:03, Jan Sipke wrote: Can you explain why there is a difference between the following two statements? a = [] a.append(1) print a [1] print [].append(1) None Try this one: a = [] print a.append(1) Does that answer your question? Kiuhnm --

Re: Appending to []

2012-04-20 Thread Chris Angelico
On Sat, Apr 21, 2012 at 6:17 AM, Rotwang sg...@hotmail.co.uk wrote: In general there's no reason why a.method(arguments) print a will print the same thing as print a.method(arguments) since a method doesn't assign the value it returns to the instance on which it is called; what it does

Re: Using arguments in a decorator

2012-04-20 Thread Rotwang
On 20/04/2012 17:10, Jon Clements wrote: On Friday, 20 April 2012 16:57:06 UTC+1, Rotwang wrote: Hi all, here's a problem I don't know how to solve. I'm using Python 2.7.2. I'm doing some stuff in Python which means I have cause to call functions that take a while to return. Since I often

Re: can I overload operators like =, - or something like that?

2012-04-20 Thread Steven W. Orr
On 4/19/2012 3:28 PM, dmitrey wrote: hi all, can I somehow overload operators like =, - or something like that? (I'm searching for appropriate overload for logical implication if a then b) Thank you in advance, D. This tickled a memory from decades back when I worked in PL/I. They have a bool

Re: can I overload operators like =, - or something like that?

2012-04-20 Thread Chris Angelico
On Sat, Apr 21, 2012 at 7:34 AM, Steven W. Orr ste...@syslang.net wrote: Then define a class called Bool that redefines things like __rlshift__ and __rrshift__. That would get = and = for Implications and nodus tolens. It's not a total solution. I can't see how you're going to get IFF, NAND and

Different results for different versions of urllib2

2012-04-20 Thread Diego Manenti Martins
Hi. Anybody knows the data is sent in a different way for Python 2.5, 2.6 and 2.7 using this code: import urllib2 url = 'http://server.com/post_image?tid=zoV6LJ' f = open('test.jpg') data = f.read() res = urllib2.urlopen(url, data) It works the same way for python2.5 and python2.6 but not

Re: Different results for different versions of urllib2

2012-04-20 Thread Terry Reedy
On 4/20/2012 6:47 PM, Diego Manenti Martins wrote: Anybody knows the data is sent in a different way for Python 2.5, 2.6 and 2.7 using this code: You could check the What's New for 2.7 and see if there is any mention of a change to urllib2. Or diff the 2.6 and 2.7 versions of urllib2.py.

Re: How do you refer to an iterator in docs?

2012-04-20 Thread Terry Reedy
On 4/20/2012 9:41 AM, Roy Smith wrote: Except that list of foos and sequence of foos make sense from a grammar standpoint, but iterator of foos does not. Or maybe it does? I consider it grammatical, but idiomatically, it *is* an innovation. Language evolves as needs evolve. -- Terry Jan

Re: why () is () and [] is [] work in other way?

2012-04-20 Thread Roy Smith
In article 877gxajit0@dpt-info.u-strasbg.fr, Alain Ketterlin al...@dpt-info.u-strasbg.fr wrote: Tuples are immutable, while lists are not. If you really want to have fun, consider this classic paradox: [] is [] False id([]) == id([]) True --

Re: Using arguments in a decorator

2012-04-20 Thread Ian Kelly
On Fri, Apr 20, 2012 at 9:57 AM, Rotwang sg...@hotmail.co.uk wrote: As far as I know, the decorated function will always return the same value as the original function. The problem is that the dictionary key stored depends on how the function was called, even if two calls should be equivalent;

Re: Using arguments in a decorator

2012-04-20 Thread Ian Kelly
On Fri, Apr 20, 2012 at 6:07 PM, Ian Kelly ian.g.ke...@gmail.com wrote:    (args, varargs, varkw, defaults) = inspect.getargspec(func)    if varargs:        args.append(varargs)    if varkw:        args.append(tuple(sorted(%s.items())) % varkw) Note that in Python 3, this would need to

Re: Different results for different versions of urllib2

2012-04-20 Thread Dave Angel
On 04/20/2012 06:47 PM, Diego Manenti Martins wrote: Hi. Anybody knows the data is sent in a different way for Python 2.5, 2.6 and 2.7 using this code: import urllib2 url = 'http://server.com/post_image?tid=zoV6LJ' f = open('test.jpg') data = f.read() res = urllib2.urlopen(url, data) It

Re: Different results for different versions of urllib2

2012-04-20 Thread Diego Manenti Martins
On Fri, Apr 20, 2012 at 10:08 PM, Dave Angel d...@davea.name wrote: On 04/20/2012 06:47 PM, Diego Manenti Martins wrote: Hi. Anybody knows the data is sent in a different way for Python 2.5, 2.6 and 2.7 using this code: import urllib2 url = 'http://server.com/post_image?tid=zoV6LJ' f =

Unable to Concatenate a file - destination kept getting overwritten

2012-04-20 Thread Foster Rilindo
I can't seem to concatenate. I got binary files here: yvaine:disk rilindo$ ls -lah total 61440 drwxr-xr-x 4 rilindo staff 136B Apr 20 19:47 . drwxr-xr-x 10 rilindo staff 340B Apr 20 19:45 .. -rw-r--r-- 1 rilindo staff20M Apr 20 20:00 disk1 -rw-r--r-- 1 rilindo staff10M Apr

Fwd: Re: Different results for different versions of urllib2

2012-04-20 Thread Dave Angel
You forgot to include the list in your response. I don't normally respond to private messages, but I'll make an exception. On Fri, Apr 20, 2012 at 10:08 PM, Dave Angel d...@davea.name wrote: On 04/20/2012 06:47 PM, Diego Manenti Martins wrote: Hi. Anybody knows the data is sent in a

Re: Unable to Concatenate a file - destination kept getting overwritten

2012-04-20 Thread Chris Angelico
On Sat, Apr 21, 2012 at 11:03 AM, Foster Rilindo rili...@me.com wrote: Is this right way to concatenate a file or is there a better way? I'd be inclined to ignore shutil and simply open one file for reading, the other for appending, and manually transfer data from one to the other.

Re: How do you refer to an iterator in docs?

2012-04-20 Thread Chris Angelico
On Sat, Apr 21, 2012 at 9:40 AM, Terry Reedy tjre...@udel.edu wrote: On 4/20/2012 9:41 AM, Roy Smith wrote: Except that list of foos and sequence of foos make sense from a grammar standpoint, but iterator of foos does not.  Or maybe it does? I consider it grammatical, but idiomatically, it

Re: Unable to Concatenate a file - destination kept getting overwritten

2012-04-20 Thread Dave Angel
On 04/20/2012 09:03 PM, Foster Rilindo wrote: I can't seem to concatenate. I got binary files here: yvaine:disk rilindo$ ls -lah total 61440 drwxr-xr-x 4 rilindo staff 136B Apr 20 19:47 . drwxr-xr-x 10 rilindo staff 340B Apr 20 19:45 .. -rw-r--r-- 1 rilindo staff20M Apr 20

Re: Unable to Concatenate a file - destination kept getting overwritten

2012-04-20 Thread MRAB
On 21/04/2012 02:03, Foster Rilindo wrote: I can't seem to concatenate. I got binary files here: yvaine:disk rilindo$ ls -lah total 61440 drwxr-xr-x 4 rilindo staff 136B Apr 20 19:47 . drwxr-xr-x 10 rilindo staff 340B Apr 20 19:45 .. -rw-r--r-- 1 rilindo staff20M Apr 20 20:00

Re: How do you refer to an iterator in docs?

2012-04-20 Thread Roy Smith
In article 4f921a2d$0$29965$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Fri, 20 Apr 2012 09:41:25 -0400, Roy Smith wrote: In article 4f910c3d$0$29965$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano

Re: Re: Different results for different versions of urllib2

2012-04-20 Thread Diego Manenti Martins
On Fri, Apr 20, 2012 at 11:09 PM, Dave Angel d...@davea.name wrote: You forgot to include the list in your response.  I don't normally respond to private messages, but I'll make an exception. Sorry about that and thanks. On 04/20/2012 06:47 PM, Diego Manenti Martins wrote: Hi. Anybody knows

Re: Unable to Concatenate a file - destination kept getting overwritten

2012-04-20 Thread Foster Rilindo
Nevermind. Dumb mistake. I should have used: destination = open(disk1,'ab') Doh. On Apr 20, 2012, at 8:03 PM, Foster Rilindo wrote: I can't seem to concatenate. I got binary files here: yvaine:disk rilindo$ ls -lah total 61440 drwxr-xr-x 4 rilindo staff 136B Apr 20 19:47 .

Re: Different results for different versions of urllib2

2012-04-20 Thread Dave Angel
On 04/20/2012 11:06 PM, Diego Manenti Martins wrote: On Fri, Apr 20, 2012 at 11:09 PM, Dave Angel d...@davea.name wrote: You forgot to include the list in your response. I don't normally respond to private messages, but I'll make an exception. Sorry about that and thanks. On 04/20/2012

Re: How do you refer to an iterator in docs?

2012-04-20 Thread Steve Howell
On Apr 20, 8:01 pm, Roy Smith r...@panix.com wrote: In article 4f921a2d$0$29965$c3e8da3$54964...@news.astraweb.com,  Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Fri, 20 Apr 2012 09:41:25 -0400, Roy Smith wrote: In article

Re: How do you refer to an iterator in docs?

2012-04-20 Thread Chris Angelico
On Sat, Apr 21, 2012 at 1:01 PM, Roy Smith r...@panix.com wrote: Because an iterator isn't a container.  I don't know, maybe it does make sense, but my first impression is that it sounds wrong. A basket of apples is a basket which contains apples, in the same way a list contains foos.  But an

Re: Difference between 'imp' and 'importlib'

2012-04-20 Thread Eric Snow
On Fri, Apr 20, 2012 at 1:30 AM, Frank Millman fr...@chagford.com wrote: Hi all I need the ability to execute a function by parsing a string containing the full path to the function. The string is multi-dotted. The last element is the function name, the second-last is the name of the module

Re: why () is () and [] is [] work in other way?

2012-04-20 Thread John O'Hagan
On Sat, 21 Apr 2012 04:25:36 +0100 Rotwang sg...@hotmail.co.uk wrote: On 21/04/2012 01:01, Roy Smith wrote: In article877gxajit0@dpt-info.u-strasbg.fr, Alain Ketterlinal...@dpt-info.u-strasbg.fr wrote: Tuples are immutable, while lists are not. If you really want to have fun,

Re: How do you refer to an iterator in docs?

2012-04-20 Thread Steven D'Aprano
On Fri, 20 Apr 2012 23:01:08 -0400, Roy Smith wrote: In article 4f921a2d$0$29965$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Fri, 20 Apr 2012 09:41:25 -0400, Roy Smith wrote: In article

Re: Re: How do you refer to an iterator in docs?

2012-04-20 Thread Evan Driscoll
On 4/20/2012 22:01, Roy Smith wrote: A basket of apples is a basket which contains apples, in the same way a list contains foos. But an iterator doesn't contain anything. You wouldn't say, a spigot of water, because the spigot isn't a container holding the water. It is simply a mechanism

Re: why () is () and [] is [] work in other way?

2012-04-20 Thread Dave Angel
On 04/20/2012 11:25 PM, Rotwang wrote: On 21/04/2012 01:01, Roy Smith wrote: In article877gxajit0@dpt-info.u-strasbg.fr, Alain Ketterlinal...@dpt-info.u-strasbg.fr wrote: Tuples are immutable, while lists are not. If you really want to have fun, consider this classic paradox: [] is

Re: why () is () and [] is [] work in other way?

2012-04-20 Thread john . tantalo
On Friday, April 20, 2012 12:34:46 PM UTC-7, Rotwang wrote: I believe it says somewhere in the Python docs that it's undefined and implementation-dependent whether two identical expressions have the same identity when the result of each is immutable I was curious where that might be on my

[issue10941] imaplib: Internaldate2tuple produces wrong result if date is near a DST change

2012-04-20 Thread Joe Peterson
Joe Peterson j...@skyrush.com added the comment: OK, fixed patch to apply cleanly to current code. BTW, this is only for python3. Is it still appropriate to patch python2? And if so, what is the correct code repo to check out for that? -- versions: +Python 3.4 Added file:

[issue14628] Clarify import statement documentation regarding what gets bound

2012-04-20 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14628 ___

[issue14629] discrepency between tokenize.detect_encoding() and PyTokenizer_FindEncodingFilename()

2012-04-20 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14629 ___

[issue13994] incomplete revert in 2.7 Distutils left two copies of customize_compiler

2012-04-20 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever status: pending - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13994 ___

[issue13994] incomplete revert in 2.7 Distutils left two copies of customize_compiler

2012-04-20 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13994 ___

[issue14624] Faster utf-16 decoder

2012-04-20 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14624 ___

[issue14626] os module: use keyword-only arguments for dir_fd and nofollow to reduce function count

2012-04-20 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: Thank you, Larry. I was going to do it, but got stuck with other things. The main objective of this proposal is to get rid of litter os module by dozen rarely popular and non-portable functions (introduced by issue4761). Moreover, the

[issue14625] Faster utf-32 decoder

2012-04-20 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14625 ___

[issue14579] Vulnerability in the utf-16 decoder after error handling

2012-04-20 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14579 ___

[issue14614] PyTuple_SET_ITEM could check bounds in debug mode

2012-04-20 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14614 ___

[issue14428] Implementation of the PEP 418

2012-04-20 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14428 ___

[issue14617] confusing docs with regard to __hash__

2012-04-20 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14617 ___

[issue14381] Intern certain integral floats for memory savings and performance

2012-04-20 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Because pfval in this example doesn't exist but is merely a temporary, there is no aliasing. Maybe aliasing wasn't the right word to use, then. The exact rule being violated is C99 6.5, para. 7 (or C11 6.5 para. 7 if you prefer): An

[issue2377] Replace __import__ w/ importlib.__import__

2012-04-20 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2377 ___

[issue14618] remove modules_reloading from the interpreter state

2012-04-20 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14618 ___

[issue14626] os module: use keyword-only arguments for dir_fd and nofollow to reduce function count

2012-04-20 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: Before starting to code, it is necessary to solve the problem of interface. With the majority of the functions all is good, but the `link` and `rename` have two `dirfd` parameters (even with different names). So I suggest two more

[issue14626] os module: use keyword-only arguments for dir_fd and nofollow to reduce function count

2012-04-20 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: It's true that, for example, dir_fd parameters won't work on Windows. The solution is to always accept the parameters and throw NotImplementedError on platforms where the functionality isn't available. Here are my thoughts on the interface

[issue14630] non-deterministic behavior of int subclass

2012-04-20 Thread Brecht Machiels
New submission from Brecht Machiels bre...@mos6581.org: I have subclassed int to add an extra attribute: class Integer(int): def __new__(cls, value, base=10, indirect=False): try: obj = int.__new__(cls, value, base) except TypeError: obj =

[issue14630] non-deterministic behavior of int subclass

2012-04-20 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14630 ___ ___

[issue14627] Fatal Python Error when Python startup is interrupted by CTRL+c

2012-04-20 Thread STINNER Victor
STINNER Victor victor.stin...@gmail.com added the comment: OK, so what's your point? =) In Python 3.3, CTRL+c at startup fails with Traceback: ..., not with a fatal error. A fatal error may dump a core dump and open a popup on Windows. -- ___

[issue13994] incomplete revert in 2.7 Distutils left two copies of customize_compiler

2012-04-20 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: Ned Deily wrote: Ned Deily n...@acm.org added the comment: That's unfortunate. But the documented location for customize_compiler is and, AFAIK, had always been in distutils.sysconfig. It was an inadvertent consequence of the bad

[issue13994] incomplete revert in 2.7 Distutils left two copies of customize_compiler

2012-04-20 Thread Marc-Andre Lemburg
Changes by Marc-Andre Lemburg m...@egenix.com: -- resolution: fixed - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13994 ___ ___

[issue13994] incomplete revert in 2.7 Distutils left two copies of customize_compiler

2012-04-20 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: Ned Deily wrote: And to recap the history here, there was a change in direction for Distutils during the 2.7 development cycle, as decided at the 2010 language summit, in particular to revert feature changes in Distutils for 2.7 to its

[issue13994] incomplete revert in 2.7 Distutils left two copies of customize_compiler

2012-04-20 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: Marc-Andre Lemburg wrote: Ned Deily n...@acm.org added the comment: That's unfortunate. But the documented location for customize_compiler is and, AFAIK, had always been in distutils.sysconfig. It was an inadvertent consequence of

[issue14381] Intern certain integral floats for memory savings and performance

2012-04-20 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Interesting. I declare that this rule does not apply here since the code is a deliberate hack: We are pretending that a certain address points to integers and checking those integers. If you insist on following the standard,

[issue14381] Intern certain integral floats for memory savings and performance

2012-04-20 Thread Kristján Valur Jónsson
Changes by Kristján Valur Jónsson krist...@ccpgames.com: -- Removed message: http://bugs.python.org/msg158808 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14381 ___

[issue14381] Intern certain integral floats for memory savings and performance

2012-04-20 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Interesting. I declare that this rule does not apply here since the code is a deliberate hack: We are pretending that a certain address points to integers and checking those integers. If you insist on following the standard,

[issue14579] Vulnerability in the utf-16 decoder after error handling

2012-04-20 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: [moving from Rietveld back to Roundup] On 2012/04/20 11:15:48, storchaka wrote: The `aligned_end` may point outside unicode object, if the unicode object was reallocated. How so? The aligned_end *never* points into the unicode object: q

  1   2   3   >