Upcoming Webinar SQLAlchemy Creator Mike Bayer on How and Why to Integrate Akiban and SQLAlchemy

2012-11-14 Thread Robert Riegel
[image: Akiban] *Upcoming Webinar:* SQLAlchemy Creator Mike Bayer on How and Why to Integrate Akiban and SQLAlchemy Hi guys, I wanted to take a minute and invite you and the Python user group to our next free webinar on SQLAchemy: Presented by: Mike Bayer, Creator of SQLAchemy,Ori Herrnstadt,

Nanpy 0.6 - Use your Arduino board with Python

2012-11-14 Thread Andrea Stagi
Hi, I'm really glad to announce you Nanpy 0.6, finally with Python3 support and a lot of bugfixing and improvements! http://pypi.python.org/pypi/nanpy/ We have issues with Leonardo boards, seems that they're unable to read serial data.. my friend Fernando Molina is working on this issue, anyway

Re: how to simulate tar filename substitution across piped subprocess.Popen() calls?

2012-11-14 Thread Hans Mulder
On 13/11/12 22:36:47, Thomas Rachel wrote: Am 12.11.2012 19:30 schrieb Hans Mulder: This will break if there are spaces in the file name, or other characters meaningful to the shell. If you change if to xargsproc.append(test -f '%s/{}' md5sum '%s/{}'

Re: creating size-limited tar files

2012-11-14 Thread Kushal Kumaran
Ian Kelly ian.g.ke...@gmail.com writes: On Tue, Nov 13, 2012 at 11:05 PM, Kushal Kumaran kushal.kumaran+pyt...@gmail.com wrote: Or, you could just change the p1's stderr to an io.BytesIO instance. Then call p2.communicate *first*. This doesn't seem to work. b = io.BytesIO() p =

Re: Detect file is locked - windows

2012-11-14 Thread Hans Mulder
On 14/11/12 02:14:59, Mark Lawrence wrote: On 14/11/2012 00:33, Ali Akhavan wrote: I am trying to open a file in 'w' mode open('file', 'wb'). open() will throw with IOError with errno 13 if the file is locked by another application or if user does not have permission to open/write to the

Re: stackoverflow quote on Python

2012-11-14 Thread wxjmfauth
Le mardi 13 novembre 2012 16:53:30 UTC+1, Mark Lawrence a écrit : On 13/11/2012 13:21, wxjmfa...@gmail.com wrote: Le mardi 13 novembre 2012 06:42:19 UTC+1, Steven D'Aprano a écrit : On Tue, 13 Nov 2012 03:08:54 +, Mark Lawrence wrote: * strings are now proper text strings

Re: Detect file is locked - windows

2012-11-14 Thread Tim Golden
On 14/11/2012 08:55, Hans Mulder wrote: On 14/11/12 02:14:59, Mark Lawrence wrote: On 14/11/2012 00:33, Ali Akhavan wrote: I am trying to open a file in 'w' mode open('file', 'wb'). open() will throw with IOError with errno 13 if the file is locked by another application or if user does not

Re: Division matrix

2012-11-14 Thread wxjmfauth
Le mardi 13 novembre 2012 02:00:28 UTC+1, Cleuson Alves a écrit : Hello, I need to solve an exercise follows, first calculate the inverse matrix and then multiply the first matrix. I await help. Thank you. follows the code below incomplete. m = [[1,2,3],[4,5,6],[7,8,9]] x =

Re: stackoverflow quote on Python

2012-11-14 Thread Chris Angelico
On Wed, Nov 14, 2012 at 7:56 PM, wxjmfa...@gmail.com wrote: I'am still fascinated by the mathematically absurd negative logic used in and by the flexible string representation (algorithm). I am still fascinated that you persist in comparing a buggy old Python against a bug-free new Python and

Re: Generate unique ID for URL

2012-11-14 Thread Johannes Bauer
On 14.11.2012 01:41, Richard Baron Penman wrote: I found the MD5 and SHA hashes slow to calculate. Slow? For URLs? Are you kidding? How many URLs per second do you want to calculate? The builtin hash is fast but I was concerned about collisions. What rate of collisions could I expect? MD5

Re: Detect file is locked - windows

2012-11-14 Thread Tim Golden
On 14/11/2012 00:33, Ali Akhavan wrote: I am trying to open a file in 'w' mode open('file', 'wb'). open() will throw with IOError with errno 13 if the file is locked by another application or if user does not have permission to open/write to the file. What version of Python are you using?

Re: Supported Platforms for Python

2012-11-14 Thread Kiran N Mallekoppa
Hi there! Our team at IBM are exploring the possibility of implementing one of our products using Python. I had a query in this regard. As per IBM's policy, we list details of platforms that our product works on - including the flavors of OS, the versions supported (and sometimes, even the

Re: Generate unique ID for URL

2012-11-14 Thread Richard
thanks for perspective! -- http://mail.python.org/mailman/listinfo/python-list

Re: Supported Platforms for Python

2012-11-14 Thread Ulrich Eckhardt
Am 14.11.2012 10:51, schrieb Kiran N Mallekoppa: 1. Is this information available somewhere? 2. I was pointed to PEP-11, which documents the platforms that are not supported. So, can we take that all active versions of Python (2.7.3 and 3.3, i believe) are supported on all the OS flavors that

Re: Generate unique ID for URL

2012-11-14 Thread Johannes Bauer
On 14.11.2012 02:39, Roy Smith wrote: The next step is to reduce the number of bits you are encoding. You said in another post that 1 collision in 10 million hashes would be tolerable. So you need: math.log(10*1000*1000, 2) 23.25349666421154 24 bits worth of key. Nope :-) Base64

Re: Detect file is locked - windows

2012-11-14 Thread Tim Golden
On 14/11/2012 00:33, Ali Akhavan wrote: I am trying to open a file in 'w' mode open('file', 'wb'). open() will throw with IOError with errno 13 if the file is locked by another application or if user does not have permission to open/write to the file. How can I distinguish these two cases ?

Re: creating size-limited tar files

2012-11-14 Thread andrea crotti
2012/11/14 Kushal Kumaran kushal.kumaran+pyt...@gmail.com: Well, well, I was wrong, clearly. I wonder if this is fixable. -- regards, kushal -- http://mail.python.org/mailman/listinfo/python-list But would it not be possible to use the pipe in memory in theory? That would be way faster

Re: Detect file is locked - windows

2012-11-14 Thread Hans Mulder
On 14/11/12 11:02:45, Tim Golden wrote: On 14/11/2012 00:33, Ali Akhavan wrote: I am trying to open a file in 'w' mode open('file', 'wb'). open() will throw with IOError with errno 13 if the file is locked by another application or if user does not have permission to open/write to the file.

Re: Detect file is locked - windows

2012-11-14 Thread Tim Golden
On 14/11/2012 11:51, Hans Mulder wrote: It would be nice if he could give specific error messages, e.g. Can't write %s because it is locked by %s. vs. Can't write %s because you don't have write access. I can't speak for Ali, but I'm always annoyed by error messages listing

Re: Generate unique ID for URL

2012-11-14 Thread Dave Angel
On 11/14/2012 06:29 AM, Johannes Bauer wrote: snip When doing these calculations, it's important to keep the birthday paradox in mind (this is kind of counter-intuitive): The chance of a collission raises tremendously when we're looking for *any* arbitrary two hashes colliding within a

Re: Generate unique ID for URL

2012-11-14 Thread Johannes Bauer
On 14.11.2012 13:33, Dave Angel wrote: Te birthday paradox could have been important had the OP stated his goal differently. What he said was: Ideally I would want to avoid collisions altogether. But if that means significant extra CPU time then 1 collision in 10 million hashes would be

Re: Simple Question regarding running .py program

2012-11-14 Thread Chris Angelico
On Wed, Nov 14, 2012 at 6:02 PM, ru...@yahoo.com wrote: On 11/13/2012 11:02 PM, Chris Angelico wrote: To be more accurate: This is deprecated *by members of* this list. As there is no commanding/controlling entity here, it's up to each individual to make a decision - for instance, abusive

Re: Python garbage collector/memory manager behaving strangely

2012-11-14 Thread Aahz
In article 50570de3$0$29981$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Mon, 17 Sep 2012 06:46:55 -0400, Dave Angel wrote: On 09/16/2012 11:25 PM, alex23 wrote: def readlines(f): lines = [] while f is not empty:

Re: Subprocess puzzle and two questions

2012-11-14 Thread Roy Smith
In article mailman.3666.1352873042.27098.python-l...@python.org, William Ray Wing w...@mac.com wrote: On Nov 13, 2012, at 11:41 PM, Roy Smith r...@panix.com wrote: In article mailman.3664.1352867713.27098.python-l...@python.org, w...@mac.com wrote: I need to time the operation of a

Re: Subprocess puzzle and two questions

2012-11-14 Thread Chris Angelico
On Thu, Nov 15, 2012 at 1:22 AM, Roy Smith r...@panix.com wrote: Oh, my. You're using DNS as a replacement for ping? Fair enough. In that case, all you really care about is that you can connect to port 53 on the server... import socket import time s = socket.socket() t0 = time.time()

Error

2012-11-14 Thread inshu chauhan
for this code m getting this error : CODE : def ComputeClasses(data): radius = .5 points = [] for cy in xrange(0, data.height): for cx in xrange(0, data.width): if data[cy,cx] != (0.0,0.0,0.0): centre = data[cy, cx]

Re: Error

2012-11-14 Thread Chris Angelico
On Thu, Nov 15, 2012 at 2:18 AM, inshu chauhan insidesh...@gmail.com wrote: for this code m getting this error : CODE : def ComputeClasses(data): if data[cy,cx] != (0.0,0.0,0.0): centre = data[cy, cx] ... dist = distance(centre,

Re: Subprocess puzzle and two questions

2012-11-14 Thread wrw
On Nov 14, 2012, at 9:22 AM, Roy Smith r...@panix.com wrote: In article mailman.3666.1352873042.27098.python-l...@python.org, William Ray Wing w...@mac.com wrote: On Nov 13, 2012, at 11:41 PM, Roy Smith r...@panix.com wrote: In article mailman.3664.1352867713.27098.python-l...@python.org,

Re: Error

2012-11-14 Thread Joel Goldstick
On Wed, Nov 14, 2012 at 10:18 AM, inshu chauhan insidesh...@gmail.comwrote: for this code m getting this error : CODE : def ComputeClasses(data): radius = .5 points = [] for cy in xrange(0, data.height): for cx in xrange(0, data.width): if data[cy,cx] !=

Re: creating size-limited tar files

2012-11-14 Thread Dave Angel
On 11/14/2012 10:56 AM, andrea crotti wrote: Ok this is all very nice, but: [andrea@andreacrotti tar_baller]$ time python2 test_pipe.py /dev/null real 0m21.215s user 0m0.750s sys 0m1.703s [andrea@andreacrotti tar_baller]$ time ls -lR /home/andrea | cat /dev/null real 0m0.986s

Re: creating size-limited tar files

2012-11-14 Thread andrea crotti
2012/11/14 Dave Angel d...@davea.name: On 11/14/2012 10:56 AM, andrea crotti wrote: Ok this is all very nice, but: [andrea@andreacrotti tar_baller]$ time python2 test_pipe.py /dev/null real 0m21.215s user 0m0.750s sys 0m1.703s [andrea@andreacrotti tar_baller]$ time ls -lR

Re: Python-list Digest, Vol 110, Issue 106

2012-11-14 Thread Jun Tanaka
Hi, I have a question about Django. I easy_installed Django1.4 and psycopg2, and python manage.py syncdb. And gave me a error; No module named psycopg2.extensions. posgre9.1 is installed. It works fine on my MAC but not my Windows. Does anyone know about this issue Hope to resolve this issue

Re: Subprocess puzzle and two questions

2012-11-14 Thread Roy Smith
I wrote: Oh, my. You're using DNS as a replacement for ping? Fair enough. In that case, all you really care about is that you can connect to port 53 on the server... s = socket.socket() s.connect(('8.8.8.8', 53)) In article mailman.3684.1352904008.27098.python-l...@python.org, Chris

Re: creating size-limited tar files

2012-11-14 Thread Dave Angel
On 11/14/2012 11:16 AM, andrea crotti wrote: 2012/11/14 Dave Angel d...@davea.name: On 11/14/2012 10:56 AM, andrea crotti wrote: Ok this is all very nice, but: [andrea@andreacrotti tar_baller]$ time python2 test_pipe.py /dev/null real 0m21.215s user 0m0.750s sys 0m1.703s

Re: Getting empty attachment with smtplib

2012-11-14 Thread Tobiah
I just found out that the attachment works fine when I read the mail from the gmail website. Thunderbird complains that the attachment is empty. Thanks, Toby On 11/14/2012 09:51 AM, Tobiah wrote: I've been sending an email blast out with smtplib and it's been working fine. I'm attaching an

Running a curl command within py script

2012-11-14 Thread Smaran Harihar
Hi Guys, i found pycurl to execute python curl command but not sure how I can execute the curl command using the pycurl. curl -u admin:geoserver -v -XPUT -H 'Content-type: text/plain' -d 'file:/var/www/geo/shapefile/csvQshp/Quercus_iltisii.shp'

How Run Py.test from PyScripter

2012-11-14 Thread san
I am a newbie to py.test , Please let me know how to run the py.test in PyScripter Editor. I have tried in the belwo way but it doesn't work. import pytest def func(x): return x + 1 def test_answer(): assert func(3) == 5 pytest.main() below is the Exception that i get Traceback (most

Re: Simple Question regarding running .py program

2012-11-14 Thread rurpy
On 11/14/2012 06:35 AM, Chris Angelico wrote: On Wed, Nov 14, 2012 at 6:02 PM, rurpy wrote: On 11/13/2012 11:02 PM, Chris Angelico wrote: To be more accurate: This is deprecated *by members of* this list. As there is no commanding/controlling entity here, it's up to each individual to make a

Re: Error

2012-11-14 Thread MRAB
On 2012-11-14 15:18, inshu chauhan wrote: for this code m getting this error : CODE : def ComputeClasses(data): radius = .5 points = [] for cy in xrange(0, data.height): for cx in xrange(0, data.width): if data[cy,cx] != (0.0,0.0,0.0):

Re: Running a curl command within py script

2012-11-14 Thread Gisle Vanem
Smaran Harihar smaran.hari...@gmail.com wrote: i found pycurl to execute python curl command but not sure how I can execute the curl command using the pycurl. curl -u admin:geoserver -v -XPUT -H 'Content-type: text/plain' -d 'file:/var/www/geo/shapefile/csvQshp/Quercus_iltisii.shp'

Re: creating size-limited tar files

2012-11-14 Thread Andrea Crotti
On 11/14/2012 04:33 PM, Dave Angel wrote: Well, as I said, I don't see how the particular timing has anything to do with the rest of the thread. If you want to do an ls within a Python program, go ahead. But if all you need can be done with ls itself, then it'll be slower to launch python just

Re: creating size-limited tar files

2012-11-14 Thread Dave Angel
On 11/14/2012 03:43 PM, Andrea Crotti wrote: SNIP Anyway the only thing I wanted to understand is if using the pipes in subprocess is exactly the same as doing the Linux pipe, or not. It's not the same thing, but you can usually assume it's close. Other effects will probably dominate any

Re: Subprocess puzzle and two questions

2012-11-14 Thread Chris Angelico
On Thu, Nov 15, 2012 at 3:20 AM, Roy Smith r...@panix.com wrote: I wrote: Oh, my. You're using DNS as a replacement for ping? Fair enough. In that case, all you really care about is that you can connect to port 53 on the server... s = socket.socket() s.connect(('8.8.8.8', 53)) In

Describing code with slides

2012-11-14 Thread John Graves
I'm trying to work out the best way to provide a description of some code in a set of presentation slides which can be played backward and forward through the bits that someone is trying to understand (rather than using a screencast -- where you can never seem to rewind just the right amount ...).

Re: Simple Question regarding running .py program

2012-11-14 Thread Steven D'Aprano
On Wed, 14 Nov 2012 10:20:13 -0800, rurpy wrote: On 11/14/2012 06:35 AM, Chris Angelico wrote: [...] I stand by what I said. Members, plural, of this list. I didn't say all members of, ergo the word some is superfluous, yet not needful, as Princess Ida put it. Then you would have no

Re: Simple Question regarding running .py program

2012-11-14 Thread rurpy
On Wednesday, November 14, 2012 4:07:53 PM UTC-7, Steven D'Aprano wrote: On Wed, 14 Nov 2012 10:20:13 -0800, rurpy wrote: [...] As an aside, I've noticed that some those most vocal against GG have also been very vocal about this group being inclusive. I call bullshit. If you are going to

Re: Simple Question regarding running .py program

2012-11-14 Thread Joshua Landau
Steven, whilst I hold you in high regard, this post seems spurned by bias. I would urge you to reconsider your *argument*, although your *position* has merit. On 14 November 2012 23:07, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Wed, 14 Nov 2012 10:20:13 -0800, rurpy

Re: access spreadsheet data

2012-11-14 Thread Terry Reedy
On 11/14/2012 1:35 AM, Amit Agrawal wrote: my problem is, i want to access data in spreadsheet to python code manualy My data is 1/1982 8:00:000 1/2/1982 8:00:000 1/3/1982 8:00:000 1/4/1982 8:00:000 1/5/1982 8:00:000.7885 1/6/1982 8:00:000 1/7/1982 8:00:000 1/8/1982 8:00:001.6127 You used

Re: Simple Question regarding running .py program

2012-11-14 Thread Steven D'Aprano
On Wed, 14 Nov 2012 23:07:53 +, Steven D'Aprano wrote: On Wed, 14 Nov 2012 10:20:13 -0800, rurpy wrote: [...] [...] As an aside, I've noticed that some those most vocal against GG have also been very vocal about this group being inclusive. I call bullshit. If you are going to accuse

Re: Simple Question regarding running .py program

2012-11-14 Thread Terry Reedy
On 11/13/2012 11:10 PM, Chris Angelico wrote: On Wed, Nov 14, 2012 at 2:31 PM, Caroline Hou joyhou2...@gmail.com wrote: Thank you Dave and everybody here for your helpful comments!This place is awesome! I found this group when I googled python-list. Seems like this is not the usual way you

Re: Simple Question regarding running .py program

2012-11-14 Thread Terry Reedy
On 11/14/2012 2:02 AM, ru...@yahoo.com wrote: On the other hand finding and configuring a newsreader for someone whose never done it before, as you recommend, is a major time consumer. Use a mail/news program such as Thunderbird and the newsreader comes for free. Setting up a gmane account

Re: Subprocess puzzle and two questions

2012-11-14 Thread Roy Smith
In article mailman.3700.1352930072.27098.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: I'm slightly surprised that there's no way with the Python stdlib to point a DNS query at a specific server Me too, including the only slightly part. The normal high-level C resolver

Python questions help

2012-11-14 Thread su29090
I brought a python book and i'm a beginner and I read and tried to do the questions and I still get it wrong. How to create a program that reads an uspecified number of integers, that determines how many positive and negative values have been read, and computes the total and average of the

Re: Python questions help

2012-11-14 Thread Chris Angelico
On Thu, Nov 15, 2012 at 12:47 PM, su29090 129k...@gmail.com wrote: I brought a python book and i'm a beginner and I read and tried to do the questions and I still get it wrong. Pick one of the questions, write as much of the code as you can, and then post the specific difficulties you're

Re: Subprocess puzzle and two questions

2012-11-14 Thread Chris Angelico
On Thu, Nov 15, 2012 at 12:49 PM, Roy Smith r...@panix.com wrote: In article mailman.3700.1352930072.27098.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: I'm slightly surprised that there's no way with the Python stdlib to point a DNS query at a specific server Me too,

Re: Subprocess puzzle and two questions

2012-11-14 Thread Roy Smith
In article mailman.3707.1352945064.27098.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: Indeed. But Python boasts that the batteries are included, and given the wealth of other networking facilities that are available, it is a bit of a hole that you can't run DNS queries in

Re: Subprocess puzzle and two questions

2012-11-14 Thread Chris Angelico
On Thu, Nov 15, 2012 at 1:10 PM, Roy Smith r...@panix.com wrote: In article mailman.3707.1352945064.27098.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: Indeed. But Python boasts that the batteries are included, and given the wealth of other networking facilities that are

Re: Subprocess puzzle and two questions

2012-11-14 Thread Dave Angel
On 11/14/2012 09:21 PM, Chris Angelico wrote: On Thu, Nov 15, 2012 at 1:10 PM, Roy Smith r...@panix.com wrote: In article mailman.3707.1352945064.27098.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: Indeed. But Python boasts that the batteries are included, and given the

Re: Subprocess puzzle and two questions

2012-11-14 Thread Kushal Kumaran
Chris Angelico ros...@gmail.com writes: On Thu, Nov 15, 2012 at 12:49 PM, Roy Smith r...@panix.com wrote: In article mailman.3700.1352930072.27098.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: I'm slightly surprised that there's no way with the Python stdlib to point a DNS

DNS from Python (was Re: Subprocess puzzle and two questions)

2012-11-14 Thread Aahz
In article mailman.3700.1352930072.27098.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: On Thu, Nov 15, 2012 at 3:20 AM, Roy Smith r...@panix.com wrote: My first thought to solve both of these is that it shouldn't be too hard to hand-craft a minimal DNS query and send it over

Re: Python garbage collector/memory manager behaving strangely

2012-11-14 Thread Dieter Maurer
a...@pythoncraft.com (Aahz) writes: ... def readlines(f): lines = [] while f is not empty: line = f.readline() if not line: break if len(line) 2 and line[-2:] == '|\n': lines.append(line) yield

Re: Getting empty attachment with smtplib

2012-11-14 Thread Dieter Maurer
Tobiah t...@tobiah.org writes: I just found out that the attachment works fine when I read the mail from the gmail website. Thunderbird complains that the attachment is empty. The MIME standard (a set of RFCs) specifies how valid messages with attachments should look like. Fetch the mail

[issue16469] Exceptions raised by Fraction() from those raised by int()

2012-11-14 Thread Mark Dickinson
Mark Dickinson added the comment: Certainly TypeError seems inappropriate here, and using ValueError for conversions from NaN sounds good to me. I'm not a big fan of the OverflowError for converting infinities to an integer: nothing's actually overflowed here. I think that should have been

[issue16469] Exceptions raised by Fraction() different from those raised by int()

2012-11-14 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- title: Exceptions raised by Fraction() from those raised by int() - Exceptions raised by Fraction() different from those raised by int() ___ Python tracker rep...@bugs.python.org

[issue16157] Irrelevant references to Misc/News

2012-11-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This issue affects only 3.3+ (see links above). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16157 ___ ___

[issue16469] Exceptions raised by Fraction() different from those raised by int()

2012-11-14 Thread Mark Dickinson
Mark Dickinson added the comment: The from_decimal method should be changed as well. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16469 ___

[issue16465] dict creation performance regression

2012-11-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: As I understand, the new dict created on every call of function with keyword arguments. This slow down every such call about 0.1 µsec. This is about 10% of int('42', base=16). In the sum, some programs can slow down to a few percents. Direct comparison

[issue14373] C implementation of functools.lru_cache

2012-11-14 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14373 ___ ___

[issue16418] argparse with many choices can generate absurdly long usage message

2012-11-14 Thread Chris Jerdonek
Chris Jerdonek added the comment: To simplify the discussion and for issue resolution purposes, I propose that the discussion about large choices containers be divided into separate discussions for (1) changes that should be applied to all maintenance releases (i.e. bug fix changes), and (2)

[issue16418] argparse with many choices can generate absurdly long usage message

2012-11-14 Thread Chris Jerdonek
Chris Jerdonek added the comment: (1) changes that should be applied to all maintenance releases (i.e. bug fix changes) This should instead read, (1) changes that should be applied to all maintenance releases (e.g. bug fix and/or documentation changes). --

[issue2333] Backport set and dict comprehensions

2012-11-14 Thread Yongzhi Pan
Yongzhi Pan added the comment: I think metal means that the different ways set is repr'd in 2.7 and 3. In 2.7: In [9]: a = {x for x in 'abracadabra' if x not in 'abc'} In [10]: repr(a) Out[10]: set(['r', 'd']) In 3.2: In [6]: a = {x for x in 'abracadabra' if x not in 'abc'} In [7]: repr(a)

[issue16469] Exceptions raised by Fraction() different from those raised by int()

2012-11-14 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- assignee: - mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16469 ___ ___

[issue16418] argparse with many choices can generate absurdly long usage message

2012-11-14 Thread Chris Jerdonek
Chris Jerdonek added the comment: The code could simply use the str or repr of the choice object It seems to me that this would result in less user-friendly behavior in many cases. It would also require the end-user to understand Python (e.g. xrange and dictionaries), which I don't think

[issue16460] Strange results for floor division (//) with non-integer divisors

2012-11-14 Thread Martin v . Löwis
Martin v. Löwis added the comment: I talked to a bunch of people (n=7) here at the company where I also give Python courses from time to time. I asked them two questions: 1. Is this behavior of FD what you would expect? 2. Given the current behavior of FD, what use cases do you see? The

[issue16460] Strange results for floor division (//) with non-integer divisors

2012-11-14 Thread Martin v . Löwis
Martin v. Löwis added the comment: Zitat von Tom Pohl rep...@bugs.python.org: This is not: 1 // 0.1 = 9.0 because math.floor(1/0.1) is able to come up with the result that is expected from an operator called floor division. You apparently assume that it is possible to give a definition

[issue16460] Strange results for floor division (//) with non-integer divisors

2012-11-14 Thread Mark Dickinson
Mark Dickinson added the comment: I believe that definining x//y as math.floor(x/y) is also confusing in other cases (without being able to construct such cases right away). In addition, defining x//y as math.floor(x / y) would break its connection with %: a key invariant is that (x //

[issue16460] Strange results for floor division (//) with non-integer divisors

2012-11-14 Thread Tom Pohl
Tom Pohl added the comment: Mark, thanks for explaining the connection of // and %. Finally, I can see why somebody would want to stick to the current behavior of FD. It renders FD useless for all of my use cases, but there are simple alternatives. Thanks for your time, Tom --

[issue16471] upgrade to sphinx 1.1

2012-11-14 Thread Chris Jerdonek
New submission from Chris Jerdonek: This issue is to upgrade Python's Sphinx from version 1.0 to 1.1. I don't already see an issue for this, and I'm not sure what upgrading entails. Personally, I'm interested in the enhanced indexing capabilities, e.g. the see and seealso entry types, as well

[issue16469] Exceptions raised by Fraction() different from those raised by int()

2012-11-14 Thread Andrew Svetlov
Changes by Andrew Svetlov andrew.svet...@gmail.com: -- nosy: +asvetlov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16469 ___ ___

[issue14373] C implementation of functools.lru_cache

2012-11-14 Thread Andrew Svetlov
Changes by Andrew Svetlov andrew.svet...@gmail.com: -- nosy: +asvetlov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14373 ___ ___

[issue16471] upgrade to sphinx 1.1

2012-11-14 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +eric.araujo, ezio.melotti, georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16471 ___

[issue16465] dict creation performance regression

2012-11-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: As I understand, the new dict created on every call of function with keyword arguments. This slow down every such call about 0.1 µsec. This is about 10% of int('42', base=16). Ok, but `int('42', base=16)` is about the fastest function call with keyword

[issue16378] venv.EnvBuilder docstring inconsistencies

2012-11-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset afb476dc202f by Vinay Sajip in branch '3.3': Issue #16378: Updated docstrings to reflect the defaults present in the code. http://hg.python.org/cpython/rev/afb476dc202f New changeset 6f0e49ed0589 by Vinay Sajip in branch 'default': Closes #16378:

[issue16465] dict creation performance regression

2012-11-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ok, but `int('42', base=16)` is about the fastest function call with keyword arguments one can think about :-) Not as fast as a call without keywords, `int('42', 16)`. :-( But this is a different issue. -- ___

[issue16418] argparse with many choices can generate absurdly long usage message

2012-11-14 Thread R. David Murray
R. David Murray added the comment: I agree with Chris that using the repr in the general case would be a regression in usability for the end user (and certainly not suitable for a maintenance release). Here is some brainstorming: We could special case this via duck typing. If the object

[issue8400] zipimporter find_module fullname mis-documented

2012-11-14 Thread Te-jé Rodgers
Te-jé Rodgers added the comment: Disregard the last...error on my part (so embarrassing!) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8400 ___

[issue8400] zipimporter find_module fullname mis-documented

2012-11-14 Thread Te-jé Rodgers
Te-jé Rodgers added the comment: It gets worse. Even though find_module works with the path separator, load_module fails. zi.find_module(lib\\ui) zipimporter object dist/Test_Editor-1.0-py3.2.zip zi.load_module(lib\\ui) Traceback (most recent call last): File stdin, line 1, in module

[issue16465] dict creation performance regression

2012-11-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a really simple patch. It speed up to 1.9x an empty dict creation (still 1.6x slower than 3.2). Make your measurements of real-world programs. -- keywords: +patch stage: - patch review Added file:

[issue11566] hypot define in pyconfig.h clashes with g++'s cmath

2012-11-14 Thread Václav Šmilauer
Václav Šmilauer added the comment: Martin, I know it is not a proper fix. OTOH, Python is not the only project which recommends its header be included as first. I don't know if it is an issue for Python 3.x; will try to test that. This bug, though, is clearly reported about Python 2.7, which

[issue16472] Distutils+mingw links agains msvcr90, while python27.dll is linked agains msvcrt

2012-11-14 Thread Václav Šmilauer
New submission from Václav Šmilauer: Compiling an extension with --compiler=mingw32 with official python 2.7.3 distribution on Windows (64bit) leads to unusable result - crash on module load (invalid access to memory). The reasons is that Lib/distutils/cygwincompiler.py#l62 links the

[issue16472] Distutils+mingw links agains msvcr90, while python27.dll is linked agains msvcrt

2012-11-14 Thread Ralf Schmitt
Changes by Ralf Schmitt python-b...@systemexit.de: -- nosy: +schmir ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16472 ___ ___ Python-bugs-list

[issue16469] Exceptions raised by Fraction() different from those raised by int()

2012-11-14 Thread Martin v . Löwis
Martin v. Löwis added the comment: The description of OverflowError is that is is raised when the result of an arithmetic operation is too large to be represented, so it doesn't actually need to overflow. Still, I see that ∞ actually isn't too large to be represented (and the documentation

[issue16458] subprocess.py throw The handle is invalid error on duplicating the STD_INPUT_HANDLE

2012-11-14 Thread Tim Golden
Changes by Tim Golden m...@timgolden.me.uk: -- nosy: +gregory.p.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16458 ___ ___ Python-bugs-list

[issue16458] subprocess.py throw The handle is invalid error on duplicating the STD_INPUT_HANDLE

2012-11-14 Thread Tim Golden
Tim Golden added the comment: On 13/11/2012 20:57, Karthk Rajagopalan wrote: I added test case using perl and python since it was easy to reproduce using perl socket module and show the issue happening with python's subprocess.py. There is definitely an action required in subprocess.py to

[issue16458] subprocess.py throw The handle is invalid error on duplicating the STD_INPUT_HANDLE

2012-11-14 Thread Karthk Rajagopalan
Karthk Rajagopalan added the comment: Hi Tim, Thanks for your reply. Yes, DuplicateHandle(..) seem to fail if the handle is to a socket under XP SP3. Can you point me to the guidelines about submitting patch so I can merge my change in main branch and upload it? We build python from

[issue16458] subprocess.py throw The handle is invalid error on duplicating the STD_INPUT_HANDLE

2012-11-14 Thread Tim Golden
Tim Golden added the comment: Start here: http://docs.python.org/devguide/ In particular: http://docs.python.org/devguide/patch.html -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16458

[issue16468] argparse only supports iterable choices

2012-11-14 Thread Chris Jerdonek
Chris Jerdonek added the comment: For the record, choices types implementing only __contains__ never worked in any cases. (I should have said ArgumentParser.add_argument() raises a ValueError in the above.) So I wonder if we should classify this as an enhancement and simply document the

[issue16400] update default PyPI behavior in docs re: listing versions

2012-11-14 Thread Chris Jerdonek
Chris Jerdonek added the comment: Martin, can you confirm that PyPI's behavior is as described in the patch? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16400 ___

[issue16290] PyComplex_AsCComplex should allow __complex__ to return float.

2012-11-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset 399e59ad0a70 by Mark Dickinson in branch 'default': Issue #16290: __complex__ must now always return an instance of complex. http://hg.python.org/cpython/rev/399e59ad0a70 -- nosy: +python-dev ___ Python

[issue16290] PyComplex_AsCComplex should allow __complex__ to return float.

2012-11-14 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16290 ___

  1   2   >