How pickle helps in reading huge files?

2013-10-16 Thread Harsh Jha
I've a huge csv file and I want to read stuff from it again and again. Is it useful to pickle it and keep and then unpickle it whenever I need to use that data? Is it faster that accessing that file simply by opening it again and again? Please explain, why? Thank you. --

Re: How pickle helps in reading huge files?

2013-10-16 Thread Stephane Wirtel
Keep it in memory On 16 oct. 2013, at 08:55 AM, Harsh Jha harshjha2...@gmail.com wrote: I've a huge csv file and I want to read stuff from it again and again. Is it useful to pickle it and keep and then unpickle it whenever I need to use that data? Is it faster that accessing that file

Re: How pickle helps in reading huge files?

2013-10-16 Thread Mark Lawrence
On 16/10/2013 07:55, Harsh Jha wrote: I've a huge csv file and I want to read stuff from it again and again. Is it useful to pickle it and keep and then unpickle it whenever I need to use that data? Is it faster that accessing that file simply by opening it again and again? Please explain,

Re: How pickle helps in reading huge files?

2013-10-16 Thread rusi
On Wednesday, October 16, 2013 12:35:42 PM UTC+5:30, Stéphane Wirtel wrote: Keep it in memory Thats a strange answer given that the OP says his file is huge. Of course 'huge' may not really be huge -- that really depends on the h/w he's using. --

Re: How pickle helps in reading huge files?

2013-10-16 Thread Chris Angelico
On Wed, Oct 16, 2013 at 7:51 PM, rusi rustompm...@gmail.com wrote: On Wednesday, October 16, 2013 12:35:42 PM UTC+5:30, Stéphane Wirtel wrote: Keep it in memory Thats a strange answer given that the OP says his file is huge. Of course 'huge' may not really be huge -- that really depends on

urllib2 timeout issue

2013-10-16 Thread Jérôme
Hi all. I'm having troubles with urllib2 timeout. See the following script : import urllib2 result = urllib2.urlopen(http://dumdgdfgdgmyurl.com/;) print result.readline() If run on my Debian Wheezy computer, or on my Debian Squeeze

Re: urllib2 timeout issue

2013-10-16 Thread Vincent Vande Vyvre
Le 16/10/2013 11:21, Jérôme a écrit : Hi all. I'm having troubles with urllib2 timeout. See the following script : import urllib2 result = urllib2.urlopen(http://dumdgdfgdgmyurl.com/;) print result.readline() If run on my Debian

Re: urllib2 timeout issue

2013-10-16 Thread Peter Otten
Jérôme wrote: Hi all. I'm having troubles with urllib2 timeout. See the following script : import urllib2 result = urllib2.urlopen(http://dumdgdfgdgmyurl.com/;) print result.readline() If run on my Debian Wheezy computer,

Re: http://pycam.sourceforge.net/

2013-10-16 Thread vinny
Erminio Ottone e...@ottone.it wrote in message news:20131013114826.1419.6522.XPN@sator... Would you like to become a developer of this program ? http://pycam.sourceforge.net/ machines stl models? The problem with stl is its just triangles. Video game stuff. Iv'e machined stl models, only

Re: urllib2 timeout issue

2013-10-16 Thread Piet van Oostrum
Jérôme jer...@jolimont.fr writes: Hi all. I'm having troubles with urllib2 timeout. See the following script : import urllib2 result = urllib2.urlopen(http://dumdgdfgdgmyurl.com/;) print result.readline() If run on my Debian

Re: Complex literals (was Re: I am never going to complain about Python again)

2013-10-16 Thread Roy Smith
In article l3l850$2aq$1...@dont-email.me, John Nagle na...@animats.com wrote: Then upgrade to 3D. You can represent latitude and longitude as a 3-element unit vector. (GPS systems do this; latitude and longitude are only generated at the end, for output.) And annoyingly so. Somebody I

Re: How pickle helps in reading huge files?

2013-10-16 Thread Roy Smith
In article 0044bfd0-f07f-4f7b-b976-5df034b6f...@googlegroups.com, Harsh Jha harshjha2...@gmail.com wrote: I've a huge csv file and I want to read stuff from it again and again. Is it useful to pickle it and keep and then unpickle it whenever I need to use that data? Is it faster that

Re: urllib2 timeout issue

2013-10-16 Thread Tim Chase
On 2013-10-16 13:22, Peter Otten wrote: The problem might be ipv6-related. I second this as the likely culprit -- I've had to disable IPv6 on my Debian laptop since my ATT router is brain-dead and doesn't seem to support it, so I would often get timeouts similar to what is the OP describes and

Re: urllib2 timeout issue

2013-10-16 Thread Tobiah
If run on my Debian Wheezy computer, or on my Debian Squeeze server, the answer is instantaneous : [...] urllib2.URLError: urlopen error [Errno -2] Name or service not known When run on my Raspberry Pi with Raspian Wheezy, the answer is identical but it takes 10 seconds. What happens when

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread Mark Janssen
On Tue, Oct 15, 2013 at 2:46 PM, Grant Edwards invalid@invalid.invalid wrote: On 2013-10-15, Mark Janssen dreamingforw...@gmail.com wrote: Yeah, well 40 years ago they didn't have parsers. That seems an odd thing to say. People were assembling and compiling computer programs long before

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread Mark Janssen
Types on the other hand correspond to our classifications and so are things in our minds. That is not how a C programmer views it. They have explicit typedefs that make it a thing for the computer. Speaking as a C programmer, no. We have explicit typedefs to create new labels for

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread rusi
On Wednesday, October 16, 2013 11:27:03 PM UTC+5:30, zipher wrote: Types on the other hand correspond to our classifications and so are things in our minds. That is not how a C programmer views it. They have explicit typedefs that make it a thing for the computer. Speaking as a C

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread Grant Edwards
On 2013-10-16, Mark Janssen dreamingforw...@gmail.com wrote: On Tue, Oct 15, 2013 at 2:46 PM, Grant Edwards invalid@invalid.invalid wrote: On 2013-10-15, Mark Janssen dreamingforw...@gmail.com wrote: Yeah, well 40 years ago they didn't have parsers. That seems an odd thing to say. People

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread Grant Edwards
On 2013-10-16, Mark Janssen dreamingforw...@gmail.com wrote: Types on the other hand correspond to our classifications and so are things in our minds. That is not how a C programmer views it. They have explicit typedefs that make it a thing for the computer. Speaking as a C programmer, no.

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread Skip Montanaro
Who uses object abstraction in C? No one. That's why C++ was invented. I wonder if you've heard of something called linux? http://lwn.net/Articles/444910/ If not, Linux, how about Python? http://hg.python.org/cpython/file/e2a411a429d6/Objects Skip --

Re: converting letters to numbers

2013-10-16 Thread Charles Hixson
On 10/13/2013 10:02 PM, Steven D'Aprano wrote: On Sun, 13 Oct 2013 20:13:32 -0700, Tim Roberts wrote: def add(c1, c2): % Decode c1 = ord(c1) - 65 c2 = ord(c2) - 65 % Process i1 = (c1 + c2) % 26 % Encode return chr(i1+65) Python uses # for comments,

Re: converting letters to numbers

2013-10-16 Thread Piet van Oostrum
Charles Hixson charleshi...@earthlink.net writes: On 10/13/2013 10:02 PM, Steven D'Aprano wrote: On Sun, 13 Oct 2013 20:13:32 -0700, Tim Roberts wrote: def add(c1, c2): % Decode c1 = ord(c1) - 65 c2 = ord(c2) - 65 % Process i1 = (c1 + c2) % 26 %

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread Chris Angelico
On Thu, Oct 17, 2013 at 5:49 AM, Skip Montanaro s...@pobox.com wrote: Who uses object abstraction in C? No one. That's why C++ was invented. I wonder if you've heard of something called linux? http://lwn.net/Articles/444910/ If not, Linux, how about Python?

Re: How pickle helps in reading huge files?

2013-10-16 Thread Peter Cacioppi
On Tuesday, October 15, 2013 11:55:26 PM UTC-7, Harsh Jha wrote: I've a huge csv file and I want to read stuff from it again and again. Is it useful to pickle it and keep and then unpickle it whenever I need to use that data? Is it faster that accessing that file simply by opening it again

Re: How pickle helps in reading huge files?

2013-10-16 Thread Irmen de Jong
On 16-10-2013 23:04, Peter Cacioppi wrote: On Tuesday, October 15, 2013 11:55:26 PM UTC-7, Harsh Jha wrote: I've a huge csv file and I want to read stuff from it again and again. Is it useful to pickle it and keep and then unpickle it whenever I need to use that data? Is it faster that

Python TkInter, GTK, GUI overall

2013-10-16 Thread Andreas Ecaz
I've been looking at TkInter and GTK to do some GUI programming, they're both cross-platform compatible. This might seem like a stupid question, but, how do people run the application? I get that I have to compile it and make it an executable. But how do I make it an executable? For Windows

Markers on a matplotlib plot

2013-10-16 Thread Brandon La Porte
I have the following code to make a plot of 4 different supply curves (economics). from matplotlib import pyplot as plt price = range(0,51) q1 = [x/2.0 for x in price] q2 = [x/4.0 for x in price] q3 = [x/5.0 for x in price] q4 = [x/10.0 for x in price] markers_on = [20, 40]

Re: Markers on a matplotlib plot

2013-10-16 Thread Mark Lawrence
On 16/10/2013 22:34, Brandon La Porte wrote: I have the following code to make a plot of 4 different supply curves (economics). from matplotlib import pyplot as plt price = range(0,51) q1 = [x/2.0 for x in price] q2 = [x/4.0 for x in price] q3 = [x/5.0 for x in price] q4 = [x/10.0 for x in

Re: converting letters to numbers

2013-10-16 Thread Rotwang
On 14/10/2013 06:02, Steven D'Aprano wrote: On Sun, 13 Oct 2013 20:13:32 -0700, Tim Roberts wrote: def add(c1, c2): % Decode c1 = ord(c1) - 65 c2 = ord(c2) - 65 % Process i1 = (c1 + c2) % 26 % Encode return chr(i1+65) Python uses # for comments, not

Re: converting letters to numbers

2013-10-16 Thread MRAB
On 16/10/2013 23:39, Rotwang wrote: On 14/10/2013 06:02, Steven D'Aprano wrote: On Sun, 13 Oct 2013 20:13:32 -0700, Tim Roberts wrote: def add(c1, c2): % Decode c1 = ord(c1) - 65 c2 = ord(c2) - 65 % Process i1 = (c1 + c2) % 26 % Encode return

Executing a Python application (was: Python TkInter, GTK, GUI overall)

2013-10-16 Thread Ben Finney
Andreas Ecaz ecazs@gmail.com writes: This might seem like a stupid question, but, how do people run the application? I get that I have to compile it and make it an executable. But how do I make it an executable? For Windows and Linux? This isn't a question about GUIs, but about making a

Testing BlockHosts

2013-10-16 Thread T . h . i . r . d_3y3
Hello Can somebody tell me how I can test BockHosts? I want to see if an IP address gets blocked or not, as I have to provide evidence of testing for a presentation. Any help will be greatly appreciated, thank you -- https://mail.python.org/mailman/listinfo/python-list

how to add object from dict

2013-10-16 Thread Mohsen Pahlevanzadeh
Dear all, I have the following code in projects.py: ##33 for row in xrange(len(uniqueFields)): instance = QtGui.QCheckBox(uniqueFields[row]) projectsFindInstance.projectsInstance.addOnFieldsInstance.update({%s %

Possibly better loop construct, also labels+goto important and on the fly compiler idea.

2013-10-16 Thread Skybuck Flying
version 0.01 created on 17 october 2013 by Skybuck Flying. (after having some experience with python which lacks repeat until/goto/labels and programming game bots) (the exit conditions described below prevent having to use logic inversion: while BeginCondition and not EndCondition - ugly logic

Re: Possibly better loop construct, also labels+goto important and on the fly compiler idea.

2013-10-16 Thread Skybuck Flying
One final example plus further analysis to be perfectly clear what fine code would look like and why it's adventage: At the bottom I come to the conclusion that the proposed loop construct with begin and ending conditions has merit after all ! ;) =D LoopBegin if not BeginningCondition

Re: how to add object from dict

2013-10-16 Thread Ben Finney
Mohsen Pahlevanzadeh moh...@pahlevanzadeh.org writes: and another file,(projectsFind.py) i have the following code: #3 for key, val in self.projectsInstance.addOnFieldsInstance.items(): instance =

Re: Possibly better loop construct, also labels+goto important and on the fly compiler idea.

2013-10-16 Thread Ben Finney
Skybuck Flying windows7i...@dreampc2006.com writes: version 0.01 created on 17 october 2013 by Skybuck Flying. Thanks for writing your essay, but it's rather too long and context-free to make a good post here. Could you please post it on your weblog instead? -- \ “Beware of and eschew

Re: how to add object from dict

2013-10-16 Thread Mohsen Pahlevanzadeh
On Thu, 2013-10-17 at 10:45 +1100, Ben Finney wrote: Mohsen Pahlevanzadeh moh...@pahlevanzadeh.org writes: and another file,(projectsFind.py) i have the following code: #3 for key, val in

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread Mark Janssen
Who uses object abstraction in C? No one. That's why C++ was invented. If not, Linux, how about Python? http://hg.python.org/cpython/file/e2a411a429d6/Objects Or huge slabs of the OS/2 Presentation Manager, which is entirely object oriented and mostly C. It's done with SOM, so it's

Re: how to add object from dict

2013-10-16 Thread Ben Finney
Mohsen Pahlevanzadeh moh...@pahlevanzadeh.org writes: Thank you for your useful link , i paste my code into [an external pastebin service] I'm glad you liked the link, but you haven't followed its advice :-) Also, pointing us to a pastebin is not helpful. Please use a user-agent that won't

Re: converting letters to numbers

2013-10-16 Thread Oscar Benjamin
On Oct 16, 2013 11:54 PM, MRAB pyt...@mrabarnett.plus.com wrote: On 16/10/2013 23:39, Rotwang wrote: On 14/10/2013 06:02, Steven D'Aprano wrote: On Sun, 13 Oct 2013 20:13:32 -0700, Tim Roberts wrote: def add(c1, c2): % Decode c1 = ord(c1) - 65 c2 = ord(c2) - 65

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread Chris Angelico
On Thu, Oct 17, 2013 at 11:13 AM, Mark Janssen dreamingforw...@gmail.com wrote: But, here it is significant that the user /consumer (i.e. *at the workstation* mind you) is *making* the object because thier visual system turns it into one. Otherwise, at the C-level, I'm guessing it's normal C

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread alex23
On 17/10/2013 3:57 AM, Mark Janssen wrote: Who uses object abstraction in C? No one. That's why C++ was invented. Aristotle maintained that women have fewer teeth than men; although he was twice married, it never occurred to him to verify this statement by examining his wives' mouths. --

Re: how to add object from dict

2013-10-16 Thread Mohsen Pahlevanzadeh
You say right, but i don't any time to read all of content of http://sscce.org/ , But when i saw its description , i found out , it's a set of law for good answer/question, Also i saw PEP 8 , it's like old style C, and i like CamelCase. But now, all of my code doesn't work and related to the given

Re: how to add object from dict

2013-10-16 Thread MRAB
On 16/10/2013 23:14, Mohsen Pahlevanzadeh wrote: Dear all, I have the following code in projects.py: ##33 for row in xrange(len(uniqueFields)): instance = QtGui.QCheckBox(uniqueFields[row])

Re: how to add object from dict

2013-10-16 Thread Chris Angelico
On Thu, Oct 17, 2013 at 11:43 AM, MRAB pyt...@mrabarnett.plus.com wrote: I'm guessing, but perhaps you need: instance = getattr(self, %s % key) How's that different from getattr(self,str(key))? ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread Ned Batchelder
On 10/16/13 8:13 PM, Mark Janssen wrote: Who uses object abstraction in C? No one. That's why C++ was invented. If not, Linux, how about Python? http://hg.python.org/cpython/file/e2a411a429d6/Objects Or huge slabs of the OS/2 Presentation Manager, which is entirely object oriented and

Re: how to add object from dict

2013-10-16 Thread Ben Finney
Mohsen Pahlevanzadeh moh...@pahlevanzadeh.org writes: You say right, but i don't any time to read all of content of http://sscce.org/ , But when i saw its description , i found out , it's a set of law for good answer/question That's right. Please take the time to help us to help you, by

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread Mark Janssen
And your earlier idea that punched cards didn't have tokens is wildly ignorant of the state of software and languages 50 years ago. Please tell me how you parsed tokens with binary switches 50 years ago. Your input is rubbish. -- MarkJ Tacoma, Washington --

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread Chris Angelico
On Thu, Oct 17, 2013 at 11:53 AM, Mark Janssen dreamingforw...@gmail.com wrote: And your earlier idea that punched cards didn't have tokens is wildly ignorant of the state of software and languages 50 years ago. Please tell me how you parsed tokens with binary switches 50 years ago. Your

Merging xls into a common one

2013-10-16 Thread John Mathew
This code works fine when there are xls in which Row has One column, but not when Row has more column. The expectation is to merge the different xls into a common one. Can somebody please help. import xlwt import xlrd import sys #Create workbook and worksheet wbk = xlwt.Workbook() dest_sheet =

Re: how to add object from dict

2013-10-16 Thread Mohsen Pahlevanzadeh
On Thu, 2013-10-17 at 11:46 +1100, Chris Angelico wrote: On Thu, Oct 17, 2013 at 11:43 AM, MRAB pyt...@mrabarnett.plus.com wrote: I'm guessing, but perhaps you need: instance = getattr(self, %s % key) How's that different from getattr(self,str(key))? ChrisA I get the string of

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread rusi
On Thursday, October 17, 2013 6:17:57 AM UTC+5:30, Ned Batchelder wrote: On 10/16/13 8:13 PM, Mark Janssen wrote: Who uses object abstraction in C? No one. That's why C++ was invented. Examples from 1. Linux Kernel 2. Python 3. OS/2 But, here it is significant that the user

Re: Markers on a matplotlib plot

2013-10-16 Thread Brandon La Porte
On Wednesday, 16 October 2013 18:31:09 UTC-4, Mark Lawrence wrote: On 16/10/2013 22:34, Brandon La Porte wrote: I have the following code to make a plot of 4 different supply curves (economics). from matplotlib import pyplot as plt price = range(0,51) q1 = [x/2.0

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread Ned Batchelder
On 10/16/13 8:53 PM, Mark Janssen wrote: And your earlier idea that punched cards didn't have tokens is wildly ignorant of the state of software and languages 50 years ago. Please tell me how you parsed tokens with binary switches 50 years ago. Your input is rubbish. The mention of punched

Re: Python was designed

2013-10-16 Thread Piet van Oostrum
Mark Janssen dreamingforw...@gmail.com writes: And your earlier idea that punched cards didn't have tokens is wildly ignorant of the state of software and languages 50 years ago. Please tell me how you parsed tokens with binary switches 50 years ago. Your input is rubbish. With all due

Sexism in the Ruby community: how does the Python community manage it?

2013-10-16 Thread Owen Jacobson
Last week, Elad Maidar wrote a fairly short but readable opinion piece[0] illustrating some long-standing social problems in the Ruby community, ending with a very specific call to action around naming conventions for Ruby projects and gems. To save you the trouble of scrolling to the bottom

Re: Sexism in the Ruby community: how does the Python community manage it?

2013-10-16 Thread random832
On Wed, Oct 16, 2013, at 23:13, Owen Jacobson wrote: * therapist - yeah, It passes as a double meaning - but still. Or a single meaning. Who's to say the person who wrote the module even had any idea it could be read otherwise? * shag Something to do with carpet? * db_nazi See below.

Re: Sexism in the Ruby community: how does the Python community manage it?

2013-10-16 Thread Devin Jeanpierre
On Wed, Oct 16, 2013 at 8:13 PM, Owen Jacobson owen.jacob...@grimoire.ca wrote: -snip- 1. What social biases and problems *do* we unwittingly encourage by way of community-tolerated behaviour? Where, if not through the conventions for naming, do we encourage sexism, racism, and other mindlessly

Re: Sexism in the Ruby community: how does the Python community manage it?

2013-10-16 Thread Ben Finney
Owen Jacobson owen.jacob...@grimoire.ca writes: 1. What social biases and problems *do* we unwittingly encourage by way of community-tolerated behaviour? This is a well-worded good question, and I'd like to draw a connection with another one you ask: 3. How can we reach out to the Ruby

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread Steven D'Aprano
On Wed, 16 Oct 2013 17:53:22 -0700, Mark Janssen wrote: And your earlier idea that punched cards didn't have tokens is wildly ignorant of the state of software and languages 50 years ago. Please tell me how you parsed tokens with binary switches 50 years ago. Your input is rubbish. Mark,

Re: Sexism in the Ruby community: how does the Python community manage it?

2013-10-16 Thread Steven D'Aprano
On Thu, 17 Oct 2013 00:22:47 -0400, random832 wrote: While this flippant usage of Nazi (based on, as I understand it, Seinfeld's soup nazi) may be offensive, it has nothing to do with sexism. If the scope of this discussion is to be offensive module names generally, then the subject line

[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: After more thought, I think that suppress() isn't as clear as ignore() and it doesn't read as well in typical use cases. I'm assigning this one back to Nick to decide. If you want to scan existing code for examples to see how well this would read, run

[issue18723] shorten function of textwrap module is susceptible to non-normalized whitespaces

2013-10-16 Thread Vajrasky Kok
Vajrasky Kok added the comment: Serhiy's commit http://hg.python.org/cpython/rev/2e8c424dc638 fixed this issue already. So I closed this ticket. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org

[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-16 Thread STINNER Victor
STINNER Victor added the comment: On python-dev, abort_on() and trap() were proposed. -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19266 ___

[issue19270] sched.cancel() breaks events order

2013-10-16 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: sched.cancel() breaks events order if events are scheduled on same time and have same priority. Patch contains tests which expose this issue. -- components: Library (Lib) files: sched_test_stable.patch keywords: patch messages: 200040 nosy:

[issue13451] sched.py: speedup cancel() method

2013-10-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- dependencies: +sched.cancel() breaks events order ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13451 ___

[issue19271] Update OrderedDict see also link

2013-10-16 Thread Mark Lawrence
New submission from Mark Lawrence: Both Python 2 and 3 docs refer to Raymond Hettinger's original recipe here http://code.activestate.com/recipes/576693/. Would it be better to link to pypi https://pypi.python.org/pypi/ordereddict? -- assignee: docs@python components: Documentation

[issue19271] Update OrderedDict see also link

2013-10-16 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: docs@python - rhettinger nosy: +rhettinger priority: normal - low ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19271

[issue16500] Add an 'atfork' module

2013-10-16 Thread Aaron Iles
Changes by Aaron Iles aaron.i...@gmail.com: -- nosy: +aliles ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16500 ___ ___ Python-bugs-list mailing

[issue17087] Improve the repr for regular expression match objects

2013-10-16 Thread Claudiu.Popa
Claudiu.Popa added the comment: Serhiy, are there any left issues with my latest patch? It would be nice if we could get this into 3.4. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17087

[issue13451] sched.py: speedup cancel() method

2013-10-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: All patches have problem with stable order. Rehashifying change it. But there are even more serious problems with current code (see issue19270). -- ___ Python tracker rep...@bugs.python.org

[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: I oppose abort_on() because it implies that it aborts the program. The word trap() is accurate but will be weird-sounding and non-communicative to users without a CS background: with trap(sqlite3.OperationalError): cursor.execute('CREATE TABLE

[issue18468] re.group() should never return a bytearray

2013-10-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18468 ___ ___

[issue18468] re.group() should never return a bytearray

2013-10-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset add40e9f7cbe by Serhiy Storchaka in branch 'default': Issue #18468: The re.split, re.findall, and re.sub functions and the group() http://hg.python.org/cpython/rev/add40e9f7cbe -- nosy: +python-dev ___

[issue18725] Multiline shortening

2013-10-16 Thread Vajrasky Kok
Vajrasky Kok added the comment: Serhiy, you forgot to add shorten to __all__. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18725 ___ ___

[issue18468] re.group() should never return a bytearray

2013-10-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Antoine for your review. -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18468

[issue19270] sched.cancel() breaks events order

2013-10-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Actually there are two bugs: 1. sched.cancel() can remove wrong event (because it uses equality instead identity). 2. sched.cancel() change order of equal (by time and priority) events. -- ___ Python tracker

[issue18725] Multiline shortening

2013-10-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0bd257cd3e88 by Serhiy Storchaka in branch 'default': Add shorten to __all_ (issues #18585 and #18725). http://hg.python.org/cpython/rev/0bd257cd3e88 -- ___ Python tracker rep...@bugs.python.org

[issue18725] Multiline shortening

2013-10-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Vajrasky. It's Antoine forgot. ;) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18725 ___ ___

[issue18585] Add a text truncation function

2013-10-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0bd257cd3e88 by Serhiy Storchaka in branch 'default': Add shorten to __all_ (issues #18585 and #18725). http://hg.python.org/cpython/rev/0bd257cd3e88 -- ___ Python tracker rep...@bugs.python.org

[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-16 Thread Stefan Krah
Stefan Krah added the comment: trap() is a bit ambiguous, since in floating point operations it means that something is actually raised and not suppressed. So one could write: from decimal import * c = getcontext() c.traps[Inexact] = True Decimal(9) / 11 # raises now! with trap(Inexact):

[issue17087] Improve the repr for regular expression match objects

2013-10-16 Thread Claudiu.Popa
Claudiu.Popa added the comment: Added the new patch, which addresses Serhiy's comments. Also, this approach fails when bytes are involved: import re re.search(ba, ba) Assertion failed: (PyUnicode_Check(op)), function _PyUnicode_CheckConsistency, file Objects/unicodeobject.c, line 309.

[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-16 Thread Zero Piraeus
Zero Piraeus added the comment: 'Ignore' and 'suppress' are not synonyms: https://www.google.com/search?q=define%3Asuppress forcibly put an end to. the rising was savagely suppressed synonyms: subdue, repress, crush, quell, quash, squash, stamp out

[issue17087] Improve the repr for regular expression match objects

2013-10-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Use correct first argument to getslice(). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17087 ___ ___

[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-16 Thread Stefan Krah
Stefan Krah added the comment: Zero Piraeus rep...@bugs.python.org wrote: 'Ignore' and 'suppress' are not synonyms: I wrote synonyms here, meaning that in *this context* they are practically synonyms. suppress describes the mechanics more precisely, ignore descibes the human intent:

[issue5342] packaging: add tests for old versions cleanup on update

2013-10-16 Thread Sergio Callegari
Sergio Callegari added the comment: Getting bitten by this with numpy/scipy installations Having previous scipy installed, pip install -I scipy creates a broken scipy installation, because the previous one is not removed and gets overwritten. For instance, an old spectral.so file leftover

[issue18314] Have os.unlink remove junction points

2013-10-16 Thread Kim Gräsman
Kim Gräsman added the comment: Gentle ping. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18314 ___ ___ Python-bugs-list mailing list

[issue17087] Improve the repr for regular expression match objects

2013-10-16 Thread Claudiu.Popa
Claudiu.Popa added the comment: Latest patch attached. -- Added file: http://bugs.python.org/file32144/sre_repr5.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17087 ___

[issue18999] Robustness issues in multiprocessing.{get, set}_start_method

2013-10-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset 72a5ac909c7a by Richard Oudkerk in branch 'default': Issue #18999: Make multiprocessing use context objects. http://hg.python.org/cpython/rev/72a5ac909c7a -- nosy: +python-dev ___ Python tracker

[issue18999] Support different contexts in multiprocessing

2013-10-16 Thread Richard Oudkerk
Changes by Richard Oudkerk shibt...@gmail.com: -- resolution: - fixed stage: - committed/rejected status: open - pending title: Robustness issues in multiprocessing.{get,set}_start_method - Support different contexts in multiprocessing type: behavior - enhancement

[issue18999] Support different contexts in multiprocessing

2013-10-16 Thread Lars Buitinck
Lars Buitinck added the comment: Thanks, much better than my solution! -- status: pending - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18999 ___

[issue5342] packaging: add tests for old versions cleanup on update

2013-10-16 Thread Alan Cristhian
Changes by Alan Cristhian alan.cri...@gmail.com: -- nosy: +Alan.Cristhian ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5342 ___ ___

[issue19272] Can't pickle lambda (while named functions are ok)

2013-10-16 Thread Facundo Batista
New submission from Facundo Batista: This is ok: Python 3.4.0a3+ (default:86af5991c809, Oct 13 2013, 16:42:52) ... import pickle def f(): ... pass ... pickle.dumps(f) b'\x80\x03c__main__\nf\nq\x00.' However, when trying to pickle a lambda, it fails: pickle.dumps(lambda:

[issue19272] Can't pickle lambda (while named functions are ok)

2013-10-16 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Functions are pickled by name, not by code. Unpickling will only work if a function with the same name is present in in the same module (__main__ in your example) This is why pickling a lambda won't work: they have no individual names. -- nosy:

[issue18999] Support different contexts in multiprocessing

2013-10-16 Thread Richard Oudkerk
Changes by Richard Oudkerk shibt...@gmail.com: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18999 ___ ___

[issue19272] Can't pickle lambda (while named functions are ok)

2013-10-16 Thread Jesús Cea Avión
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19272 ___ ___ Python-bugs-list mailing list

[issue19272] Can't pickle lambda (while named functions are ok)

2013-10-16 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: Would be interesting to be able to pickle function.__code__. Although, thinking about this, it would be not portable between Python releases, something that pickle guarantee. Thoughs? -- ___ Python tracker

[issue17087] Improve the repr for regular expression match objects

2013-10-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is too complicated (and perhaps erroneous). Why not use just self-pattern-logical_charsize? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17087 ___

[issue19272] Can't pickle lambda (while named functions are ok)

2013-10-16 Thread Ethan Furman
Ethan Furman added the comment: According to the docs[1]: 12.1.4. What can be pickled and unpickled? The following types can be pickled: - None, True, and False - integers, floating point numbers, complex numbers - strings, bytes, bytearrays - tuples, lists, sets, and

  1   2   >