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

2013-10-11 Thread Chris Angelico
On Fri, Oct 11, 2013 at 11:13 AM, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On Fri, 11 Oct 2013 01:20:01 +1100, Chris Angelico ros...@gmail.com declaimed the following: This belongs in the Izzet League, I think. Was that an MtG reference? It most assuredly was. The Ravnican

Multi-threading in Python vs Java

2013-10-11 Thread Peter Cacioppi
Could someone give me a brief thumbnail sketch of the difference between multi-threaded programming in Java. I have a fairly sophisticated algorithm that I developed as both a single threaded and multi-threaded Java application. The multi-threading port was fairly simple, partly because Java

Re: super in Python 3 and variadic arguments

2013-10-11 Thread Chris Angelico
On Fri, Oct 11, 2013 at 2:00 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: I'll now go and write I will always test my code snippets before posting on the blackboard one hundred times. print(I will always test my code snippets before posting\n*100) ChrisA PS. Irony would be

Re: Passing C pionters to Python for use with cffi

2013-10-11 Thread dieter
Eric Frederich eric.freder...@gmail.com writes: I'm extending an application that supports customization using the C language. I am able to write standalone python applications that use the C API's using cffi. This is good, but only a first step. This application allows me to register code

Re: super in Python 3 and variadic arguments

2013-10-11 Thread Marco Buttu
On 10/11/2013 04:33 AM, Ian Kelly wrote: On Thu, Oct 10, 2013 at 8:11 PM, Steven D'Aprano One of the side-effects of this being a hack is that this doesn't work: class X(Y): def method(self, arg): f = super f().method(arg) Actually, that works just fine. The

Re: super in Python 3 and variadic arguments

2013-10-11 Thread Marco Buttu
On 10/11/2013 04:11 AM, Steven D'Aprano wrote: super() with no arguments is*completely* a hack[1], and one where GvR has said Never again! if I remember correctly. I don't think he regrets allowing the super compile-time magic, just that it really is magic and he doesn't want to make a habit

Debug (sympy-Function; lambdify)

2013-10-11 Thread Surbhi Gupta
This is the code I m trying to run: from sympy import * import numpy as np from sympy import symbols def deriv(x,t): a = array(x) for i in range(0,len(x)): temp = x[i] a[i] = temp[0].diff(t) return a def matrixmult (A, B): C = [[0 for row in range(len(A))] for

Re: Skipping decorators in unit tests

2013-10-11 Thread Cameron Simpson
On 11Oct2013 05:51, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Fri, 11 Oct 2013 15:36:29 +1100, Cameron Simpson wrote: But is it reliable? Will it work on any decorated function? *Any* decorated function? No, of course not, since decorators can do anything they like:

Re: Multi-threading in Python vs Java

2013-10-11 Thread Cameron Simpson
On 10Oct2013 23:01, Peter Cacioppi peter.cacio...@gmail.com wrote: Could someone give me a brief thumbnail sketch of the difference between multi-threaded programming in Java. I have a fairly sophisticated algorithm that I developed as both a single threaded and multi-threaded Java

Re: Debug (sympy-Function; lambdify)

2013-10-11 Thread Marco Buttu
On 10/11/2013 08:28 AM, Surbhi Gupta wrote: This is the code I m trying to run: from sympy import * import numpy as np from sympy import symbols def deriv(x,t): a = array(x) for i in range(0,len(x)): temp = x[i] a[i] = temp[0].diff(t) return a def matrixmult

Re: closure = decorator?

2013-10-11 Thread Jussi Piitulainen
Roy Smith writes: In article m2a9ihxf3a@cochabamba.vanoostrum.org, Piet van Oostrum wrote: I usually say that a closure is a package, containing a function with some additional data it needs. The data usually is in the form of name bindings. That's pretty close to the way I think

Unicode Objects in Tuples

2013-10-11 Thread Stephen Tucker
I am using IDLE, Python 2.7.2 on Windows 7, 64-bit. I have four questions: 1. Why is it that print unicode_object displays non-ASCII characters in the unicode object correctly, whereas print (unicode_object, another_unicode_object) displays non-ASCII characters in the unicode objects

Re: I am never going to complain about Python again

2013-10-11 Thread Joshua Landau
On 11 October 2013 03:08, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Your mistake here seems to be that you're assuming that if two numbers are equal, they must be in the same domain, but that's not the case. (Perhaps you think that 0.0 == 0+0j should return False?) It's

Re: Skipping decorators in unit tests

2013-10-11 Thread Terry Reedy
On 10/10/2013 11:13 PM, Cameron Simpson wrote: On 11Oct2013 02:55, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: def undecorate(f): Return the undecorated inner function from function f. return f.func_closure[0].cell_contents Whereas this feels like black magic. Is

Re: Skipping decorators in unit tests

2013-10-11 Thread Terry Reedy
On 10/11/2013 12:36 AM, Steven D'Aprano wrote: I also like Terry Reedy's suggestion of having the decorator automatically add the unwrapped function to the wrapped function as an attribute: def decorate(func): @functools.wraps(func) def inner(arg): blah blah

Re: Skipping decorators in unit tests

2013-10-11 Thread Terry Reedy
On 10/11/2013 4:17 AM, Terry Reedy wrote: On 10/10/2013 11:13 PM, Cameron Simpson wrote: On 11Oct2013 02:55, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: def undecorate(f): Return the undecorated inner function from function f. return f.func_closure[0].cell_contents

Re: Unicode Objects in Tuples

2013-10-11 Thread Ben Finney
Stephen Tucker stephen_tuc...@sil.org writes: I am using IDLE, Python 2.7.2 on Windows 7, 64-bit. Python 2 is not as good at Unicode as Python 3. In fact, one of the major reasons to switch to Python 3 is that it fixes Unicode behaviour that was worse in Python 2. I have four questions: 1.

Re: Skipping decorators in unit tests

2013-10-11 Thread Terry Reedy
On 10/11/2013 4:17 AM, Terry Reedy wrote: On 10/10/2013 11:13 PM, Cameron Simpson wrote: On 11Oct2013 02:55, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: def undecorate(f): Return the undecorated inner function from function f. return f.func_closure[0].cell_contents

Re: Multi-threading in Python vs Java

2013-10-11 Thread Peter Cacioppi
On Thursday, October 10, 2013 11:01:25 PM UTC-7, Peter Cacioppi wrote: Could someone give me a brief thumbnail sketch of the difference between multi-threaded programming in Java. I have a fairly sophisticated algorithm that I developed as both a single threaded and multi-threaded Java

Re: Multi-threading in Python vs Java

2013-10-11 Thread Chris Angelico
On Fri, Oct 11, 2013 at 7:41 PM, Peter Cacioppi peter.cacio...@gmail.com wrote: So, my hope is that the GIL restrictions won't be problematic here. That is to say, I don't need **Python** code to ever run concurrently. I just need Python to allow a different Python worker thread to execute

Re: Unicode Objects in Tuples

2013-10-11 Thread Peter Otten
Stephen Tucker wrote: I am using IDLE, Python 2.7.2 on Windows 7, 64-bit. I have four questions: 1. Why is it that print unicode_object displays non-ASCII characters in the unicode object correctly, whereas print (unicode_object, another_unicode_object) displays non-ASCII

Re: I am never going to complain about Python again

2013-10-11 Thread Steven D'Aprano
On Fri, 11 Oct 2013 09:17:37 +0100, Joshua Landau wrote: On 11 October 2013 03:08, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Your mistake here seems to be that you're assuming that if two numbers are equal, they must be in the same domain, but that's not the case. (Perhaps

Re: Unicode Objects in Tuples

2013-10-11 Thread Ned Batchelder
On 10/11/13 4:16 AM, Stephen Tucker wrote: I am using IDLE, Python 2.7.2 on Windows 7, 64-bit. I have four questions: 1. Why is it that print unicode_object displays non-ASCII characters in the unicode object correctly, whereas print (unicode_object, another_unicode_object) displays

Re: closure = decorator?

2013-10-11 Thread Steven D'Aprano
On Fri, 11 Oct 2013 10:14:29 +0300, Jussi Piitulainen wrote: Roy Smith writes: In article m2a9ihxf3a@cochabamba.vanoostrum.org, Piet van Oostrum wrote: I usually say that a closure is a package, containing a function with some additional data it needs. The data usually is in the

Re: Multi-threading in Python vs Java

2013-10-11 Thread Steven D'Aprano
On Fri, 11 Oct 2013 17:53:02 +1100, Cameron Simpson wrote: Other Python implementations may be more aggressive. I'd suppose Jypthon could multithread like Java, but really I have no experience with them. Neither Jython nor IronPython have a GIL. The standard answer with CPython is that if

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

2013-10-11 Thread David
On 11 October 2013 12:27, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Fri, 11 Oct 2013 00:25:27 +1100, Chris Angelico wrote: On Fri, Oct 11, 2013 at 12:09 AM, Roy Smith r...@panix.com wrote: BTW, one of the earliest things that turned me on to Python was when I discovered

Re: Skipping decorators in unit tests

2013-10-11 Thread Gilles Lenfant
Cameron, Steven, Ben, Ned, Terry, Roy. Many thanks for this interesting discussion. I ended up... mixing some solutions provided by your hints : * Adding an __original__ attribute to the wrapper func in the decorators of my own * Playing with func_closure to test functions/methods provided by

Re: I am never going to complain about Python again

2013-10-11 Thread Chris Angelico
On Fri, Oct 11, 2013 at 8:11 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: If you implicitly decide to promote entities, then of course you can promote y to a real then take the invoice. Either you're channelling Bugs Bunny or you're trying to sell me something... you mean

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

2013-10-11 Thread Nobody
On Thu, 10 Oct 2013 14:12:36 +, Grant Edwards wrote: Nope. i is electical current (though it's more customary to use upper case). I is steady-state current (either AC or DC), i is small-signal current. -- https://mail.python.org/mailman/listinfo/python-list

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

2013-10-11 Thread Oscar Benjamin
On 11 October 2013 10:35, David bouncingc...@gmail.com wrote: On 11 October 2013 12:27, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Fri, 11 Oct 2013 00:25:27 +1100, Chris Angelico wrote: On Fri, Oct 11, 2013 at 12:09 AM, Roy Smith r...@panix.com wrote: BTW, one of the

Re: closure = decorator?

2013-10-11 Thread Jussi Piitulainen
Steven D'Aprano writes: On Fri, 11 Oct 2013 10:14:29 +0300, Jussi Piitulainen wrote: Roy Smith writes: In article m2a9ihxf3a@cochabamba.vanoostrum.org, Piet van Oostrum wrote: I usually say that a closure is a package, containing a function with some additional data it needs.

Re: closure = decorator?

2013-10-11 Thread Franck Ditter
In article 5257c3dd$0$29984$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Fri, 11 Oct 2013 10:14:29 +0300, Jussi Piitulainen wrote: Roy Smith writes: In article m2a9ihxf3a@cochabamba.vanoostrum.org, Piet van Oostrum wrote:

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

2013-10-11 Thread Jussi Piitulainen
Oscar Benjamin writes: tried to explain why their field couldn't use π for the circumference of a unit circle I would suggest that they adjust the other parts of their notation not π (there are other uses of π. There's τ for the full circle; π is used for half the circumference. duck/ --

Re: I am never going to complain about Python again

2013-10-11 Thread Neil Cerutti
On 2013-10-11, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Thu, 10 Oct 2013 17:48:16 +, Neil Cerutti wrote: 5.0 == abs(3 + 4j) False Did you maybe accidentally rebind abs? If not, what version of Python are you using? Honestly, I think I got my Python term and my

Process pending Tk events from GObject main loop?

2013-10-11 Thread Skip Montanaro
I know I have things bassackwards, but trying to process Gtk events from Tkinter's main loop using after() isn't working. (I suspect our underlying C++ (ab)use of Gtk may require a Gtk main loop). I'd like to process Tk events periodically from a GObject main loop. I know I want to call

Re: Is this the room for an argument?

2013-10-11 Thread Roy Smith
In article 5223ac4a-783e-405d-84a4-239070b66...@googlegroups.com, John Ladasky john_lada...@sbcglobal.net wrote: On Thursday, October 10, 2013 5:07:11 PM UTC-7, Roy Smith wrote: I'd like an argument, please. 'Receptionist' (Rita Davies) - Yes, sir? 'Man' (Michael Palin) - I'd like to have

ANN: CUI text editor Kaa 0.0.4

2013-10-11 Thread Atsuo Ishimoto
Hi, I've just released Kaa 0.0.4 to PyPI. https://pypi.python.org/pypi/kaaedit/ Kaa is a easy yet powerful text editor for console user interface, providing numerous features like - Macro recording. - Undo/Redo. - Multiple windows/frames. - Syntax highlighting. - Open source software(MIT)

Re: Unicode Objects in Tuples

2013-10-11 Thread Stephen Tucker
A quick reply to all you contributors (by the way, I was not expecting to get so many responses so quickly - I am (as you probably realise) new to this kind of thing. I am stuck with Python 2.X because ESRI's ArcGIS system uses it - otherwise, yes, you're all right, I would be in Python 3.X like

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

2013-10-11 Thread Roy Smith
In article mailman.1001.1381491074.18130.python-l...@python.org, Oscar Benjamin oscar.j.benja...@gmail.com wrote: If someone tried to explain why their field couldn't use ð for the circumference of a unit circle I would suggest that they adjust the other parts of their notation not ð (there

calculating download speed from .pcap file

2013-10-11 Thread patrick
hi, im looking for a way to calculate download speed for a http connection inside my .pcap file. but doing even a simple read with dpkt doesnt really work. import pcap, dpkt import socket pcapReader = dpkt.pcap.Reader(file(http-download.pcap)) for ts, data in pcapReader: print ts,

Re: Multi-threading in Python vs Java

2013-10-11 Thread Piet van Oostrum
Chris Angelico ros...@gmail.com writes: On Fri, Oct 11, 2013 at 7:41 PM, Peter Cacioppi peter.cacio...@gmail.com wrote: So, my hope is that the GIL restrictions won't be problematic here. That is to say, I don't need **Python** code to ever run concurrently. I just need Python to allow a

Consolidate several lines of a CSV file with firewall rules

2013-10-11 Thread juanscopp
Hi guys. I have a CSV file, which I created using an HTML export from a Check Point firewall policy. Each rule is represented as several lines, in some cases. That occurs when a rule has several address sources, destinations or services. I need the output to have each rule described in only one

Consolidate several lines of a CSV file with firewall rules

2013-10-11 Thread Starriol
Hi guys. I have a CSV file, which I created using an HTML export from a Check Point firewall policy. Each rule is represented as several lines, in some cases. That occurs when a rule has several address sources, destinations or services. I need the output to have each rule described in only one

Re: Consolidate several lines of a CSV file with firewall rules

2013-10-11 Thread Joel Goldstick
On Fri, Oct 11, 2013 at 11:01 AM, Starriol juansc...@gmail.com wrote: Hi guys. I have a CSV file, which I created using an HTML export from a Check Point firewall policy. Each rule is represented as several lines, in some cases. That occurs when a rule has several address sources,

Problem in Multiprocessing module

2013-10-11 Thread William Ray Wing
I'm running into a problem in the multiprocessing module. My code is running four parallel processes which are doing network access completely independently of each other (gathering data from different remote sources). On rare circumstances, the code blows up when one of my processes has do

Regarding URL Shortener

2013-10-11 Thread Datin Farah Natasha
Hello guys, i want to make a simple sript that can automatically generate normal to adf.ly links using my accounts? it is possible for me to do this using python and use it as python command line. if it's possible what library do i need to use? any help will be appreciated. --

Re: closure = decorator?

2013-10-11 Thread Steven D'Aprano
On Fri, 11 Oct 2013 15:01:40 +0300, Jussi Piitulainen wrote: Steven D'Aprano writes: Closures have nothing to do with *arguments*. A better definition of a closure is that it is a function together with a snapshot of the environment it was called from. [...] Second, it's precisely not (a

Re: I am never going to complain about Python again

2013-10-11 Thread Joshua Landau
On 11 October 2013 10:11, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Fri, 11 Oct 2013 09:17:37 +0100, Joshua Landau wrote: On 11 October 2013 03:08, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Given: x ∈ ℝ, x = 2 (reals) y ∈ ℕ, y = 2 (natural numbers)

Re: Regarding URL Shortener

2013-10-11 Thread Steven D'Aprano
On Fri, 11 Oct 2013 09:14:08 -0700, Datin Farah Natasha wrote: Hello guys, i want to make a simple sript that can automatically generate normal to adf.ly links using my accounts? it is possible for me to do this using python and use it as python command line. if it's possible what library do

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

2013-10-11 Thread Steven D'Aprano
On Fri, 11 Oct 2013 10:05:03 -0400, Roy Smith wrote: In article mailman.1001.1381491074.18130.python-l...@python.org, Oscar Benjamin oscar.j.benja...@gmail.com wrote: If someone tried to explain why their field couldn't use ð for the circumference of a unit circle I would suggest that they

Re: Unicode Objects in Tuples

2013-10-11 Thread Steven D'Aprano
On Fri, 11 Oct 2013 09:16:36 +0100, Stephen Tucker wrote: I am using IDLE, Python 2.7.2 on Windows 7, 64-bit. I have four questions: 1. Why is it that print unicode_object displays non-ASCII characters in the unicode object correctly, whereas print (unicode_object,

Re: datetime.timedelta.replace?

2013-10-11 Thread Joshua Landau
On 9 October 2013 16:15, Skip Montanaro s...@pobox.com wrote: Datetime objects have a replace method, but timedelta objects don't. If I take the diff of two datetimes and want to zero out the microseconds field, is there some way to do it more cleanly than this? delta = dt1 - dt2 zero_delta

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

2013-10-11 Thread Gene Heskett
On Friday 11 October 2013 12:49:40 Roy Smith did opine: In article mailman.1001.1381491074.18130.python-l...@python.org, Oscar Benjamin oscar.j.benja...@gmail.com wrote: If someone tried to explain why their field couldn't use ً for the circumference of a unit circle I would suggest that

Re: Skipping decorators in unit tests

2013-10-11 Thread Ethan Furman
On 10/10/2013 08:01 PM, Roy Smith wrote: On 10Oct2013 19:44, Ned Batchelder n...@nedbatchelder.com wrote: I have to admit I'm having a hard time understanding why you'd need to test the undecorated functions. After all, the undecorated functions aren't available to anyone. All that matters is

Re: Unicode Objects in Tuples

2013-10-11 Thread Piet van Oostrum
Stephen Tucker stephen_tuc...@sil.org writes: ESRI compound the problem, actually, by making all the strings that the ArcGIS Python interface delivers (from MS SQLServer) Unicode! (I suppose, on reflection, they have no choice.) So I am stuck with the worst of both worlds - a generation of

Re: Skipping decorators in unit tests

2013-10-11 Thread Ethan Furman
On 10/10/2013 08:13 PM, Cameron Simpson wrote: On 11Oct2013 02:55, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Fri, 11 Oct 2013 09:12:38 +1100, Cameron Simpson wrote: Speaking for myself, I would be include to recast this code: @absolutize def addition(a, b):

Re: Skipping decorators in unit tests

2013-10-11 Thread Ned Batchelder
On 10/10/13 10:22 PM, Cameron Simpson wrote: On 10Oct2013 19:44, Ned Batchelder n...@nedbatchelder.com wrote: On 10/10/13 6:12 PM, Cameron Simpson wrote: Speaking for myself, I would be include to recast this code: @absolutize def addition(a, b): return a + b into: def

Re: Regarding URL Shortener

2013-10-11 Thread Datin Farah Natasha
On Saturday, October 12, 2013 1:02:30 AM UTC+8, Steven D'Aprano wrote: On Fri, 11 Oct 2013 09:14:08 -0700, Datin Farah Natasha wrote: Hello guys, i want to make a simple sript that can automatically generate normal to adf.ly links using my accounts? it is possible for me to do

Re: Multi-threading in Python vs Java

2013-10-11 Thread Terry Reedy
On 10/11/2013 4:41 AM, Peter Cacioppi wrote: I should add that the computational heavy lifting is done in a third party library. So a worker thread looks roughly like this (there is a subtle race condition I'm glossing over). while len(jobs) : job = jobs.pop() model = Model(job)

Re: Process pending Tk events from GObject main loop?

2013-10-11 Thread Christian Gollwitzer
Am 11.10.13 14:52, schrieb Skip Montanaro: I know I have things bassackwards, but trying to process Gtk events from Tkinter's main loop using after() isn't working. (I suspect our underlying C++ (ab)use of Gtk may require a Gtk main loop). I'd like to process Tk events periodically from a

Re: Unicode Objects in Tuples

2013-10-11 Thread Terry Reedy
On 10/11/2013 9:31 AM, Stephen Tucker wrote: to be able to by itself. The distinction between the geekiness of a tuple compared with the non-geekiness of a string is, itself, far too geeky for my liking. The distinction seems to be an utterly spurious - even artificial or arbitrary one to me.

Re: Multi-threading in Python vs Java

2013-10-11 Thread Peter Cacioppi
On Thursday, October 10, 2013 11:01:25 PM UTC-7, Peter Cacioppi wrote: Could someone give me a brief thumbnail sketch of the difference between multi-threaded programming in Java. I have a fairly sophisticated algorithm that I developed as both a single threaded and multi-threaded Java

Re: Consolidate several lines of a CSV file with firewall rules

2013-10-11 Thread Tim Chase
On 2013-10-11 08:01, Starriol wrote: NO.;NAME;SOURCE;DESTINATION;VPNnbsp;nbsp;;SERVICE;ACTION;TRACK;INSTALL ON;TIME;COMMENT 1;;fwxcluster;mcast_vrrp;;vrrp;accept;Log;fwxcluster;Any;VRRP;;*Comment suppressed* ;igmp**;

Re: Consolidate several lines of a CSV file with firewall rules [PS]

2013-10-11 Thread Tim Chase
On 2013-10-11 15:40, Tim Chase wrote: the dangling open-quotes on #1 that cause most CSV parsers to read until the subsequent line is read. And by subsequent line, I mean subsequent closing-quote of course. :-) -tkc -- https://mail.python.org/mailman/listinfo/python-list

Re: closure = decorator?

2013-10-11 Thread Terry Reedy
On 10/11/2013 12:44 PM, Steven D'Aprano wrote: On Fri, 11 Oct 2013 15:01:40 +0300, Jussi Piitulainen wrote: Steven D'Aprano writes: Closures have nothing to do with *arguments*. A better definition of a closure is that it is a function together with a snapshot of the environment it was called

Re: closure = decorator?

2013-10-11 Thread Terry Reedy
On 10/11/2013 8:08 AM, Franck Ditter wrote: In article 5257c3dd$0$29984$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Fri, 11 Oct 2013 10:14:29 +0300, Jussi Piitulainen wrote: Roy Smith writes: In article

Re: Consolidate several lines of a CSV file with firewall rules [PS]

2013-10-11 Thread Starriol
On Friday, October 11, 2013 5:50:06 PM UTC-3, Tim Chase wrote: On 2013-10-11 15:40, Tim Chase wrote: the dangling open-quotes on #1 that cause most CSV parsers to read until the subsequent line is read. And by subsequent line, I mean subsequent closing-quote of course. :-)

Re: Multi-threading in Python vs Java

2013-10-11 Thread Cameron Simpson
On 11Oct2013 15:53, Terry Reedy tjre...@udel.edu wrote: On 10/11/2013 4:41 AM, Peter Cacioppi wrote: I should add that the computational heavy lifting is done in a third party library. So a worker thread looks roughly like this (there is a subtle race condition I'm glossing over). while

Re: Skipping decorators in unit tests

2013-10-11 Thread Cameron Simpson
On 11Oct2013 02:37, Gilles Lenfant gilles.lenf...@gmail.com wrote: * Adding an __original__ attribute to the wrapper func in the decorators of my own Just one remark: Call this __original or _original (or even original). The __x__ names are reserved for python operations (like __add__,

Re: ANN: CUI text editor Kaa 0.0.4

2013-10-11 Thread Dave Angel
On 11/10/2013 07:09, Atsuo Ishimoto wrote: Hi, I've just released Kaa 0.0.4 to PyPI. https://pypi.python.org/pypi/kaaedit/ Kaa is a easy yet powerful text editor for console user interface, What's a console user interface? That's what Windows calls a DOS box. But otherwise you seem

Re: Consolidate several lines of a CSV file with firewall rules [PS]

2013-10-11 Thread Mark Lawrence
On 11/10/2013 22:22, Starriol wrote: On Friday, October 11, 2013 5:50:06 PM UTC-3, Tim Chase wrote: On 2013-10-11 15:40, Tim Chase wrote: the dangling open-quotes on #1 that cause most CSV parsers to read until the subsequent line is read. And by subsequent line, I mean subsequent

Re: Problem in Multiprocessing module

2013-10-11 Thread Terry Reedy
On 10/11/2013 10:53 AM, William Ray Wing wrote: I'm running into a problem in the multiprocessing module. My code is running four parallel processes which are doing network access completely independently of each other (gathering data from different remote sources). On rare circumstances,

Inter-process locking

2013-10-11 Thread Jason Friedman
I have a 3rd-party process that runs for about a minute and supports only a single execution at a time. $ deploy If I want to launch a second process I have to wait until the first finishes. Having two users wanting to run at the same time might happen a few times a day. But, these users will

Metaclass/abc hackery

2013-10-11 Thread Demian Brecht
As with most I'm sure, short of using abc's, I've had very little exposure to metaclasses. So, when digging into abc implementation, I figured it would be a good idea to dig into metaclasses, their usage and actually try writing one. What I did may be contrived, but it was fun nonetheless and a

OT: looking for best solutions for tracking projects and skills

2013-10-11 Thread Jason Hsu
I realize this is off-topic, but I'm not sure what forum is best for asking about this. I figure that at least a few of you are involved in civic hacking groups. I recently joined a group that does civic hacking. (Adopt-A-Hydrant is an example of civic hacking.) We need a solution for

job openiongs @ CompSoft India

2013-10-11 Thread swetha N
job openiongs @ CompSoft India Job Title: Software Engineer Qualification: Any Graduate Experience: Fresher Location: Chennai for more details apply click here: http://referenceglobe.com/Postings_Internal/view_job_details_encoded.php?postid=MTM5MQ== --

Re: Inter-process locking

2013-10-11 Thread Piet van Oostrum
Jason Friedman jsf80...@gmail.com writes: I have a 3rd-party process that runs for about a minute and supports only a single execution at a time. $ deploy If I want to launch a second process I have to wait until the first finishes. Having two users wanting to run at the same time might

Re: Metaclass/abc hackery

2013-10-11 Thread Marco Buttu
On 10/12/2013 04:47 AM, Demian Brecht wrote: Working on this though brought up a question: Is there anything in the data model that acts like __setattr__ but when operating on a class definition instead of an instance? I'd be able to get rid of the late_bind function if something like that's

[issue18233] SSLSocket.getpeercertchain()

2013-10-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: The patch needs a test, a proper doc, and reviewing. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18233 ___

[issue3982] support .format for bytes

2013-10-11 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/issue3982 ___

[issue19201] lzma and 'x' mode open

2013-10-11 Thread Arfrever Frehtes Taifersar Arahesis
Arfrever Frehtes Taifersar Arahesis added the comment: Is there any reason why the order of characters matters here? builtins.open() supports them in any order (br==rb, bw==wb, ba==ab, bx==xb). -- nosy: +Arfrever ___ Python tracker

[issue19222] gzip and 'x' mode open

2013-10-11 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/issue19222 ___

[issue19223] bz2 and 'x' mode open

2013-10-11 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/issue19223 ___

[issue19201] lzma and 'x' mode open

2013-10-11 Thread Arfrever Frehtes Taifersar Arahesis
Arfrever Frehtes Taifersar Arahesis added the comment: Also tarfile.open() could support x mode. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19201 ___

[issue18233] SSLSocket.getpeercertchain()

2013-10-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: Sorry for the incorrect answer. I just noticed there was a test in the patch! Further looking at it, I notice the new function is returning a tuple. Wouldn't it be better to return a list here? -- ___ Python tracker

[issue18233] SSLSocket.getpeercertchain()

2013-10-11 Thread Dustin Oprea
Dustin Oprea added the comment: My two-cents is to leave it a tuple (why not?). Dustin -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18233 ___

[issue19224] Make hash(None) consistent among processes

2013-10-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: Is this something we actually want to support officially? Many other types have non-repeatable hashes, e.g.: $ PYTHONHASHSEED=1 python3 -c print(hash((lambda: 0))) 8771754605115 $ PYTHONHASHSEED=1 python3 -c print(hash((lambda: 0))) 8791504743739 $

[issue19218] Use of MutableMapping in os module slows down interpreter startup

2013-10-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: -1 on such hacks. I much prefer the _abcoll approach. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19218 ___

[issue19218] Use of MutableMapping in os module slows down interpreter startup

2013-10-11 Thread STINNER Victor
STINNER Victor added the comment: The collections module is loaded by the io module. You removed from collections.abc import MutableMapping from os.py. To be useful, you have also to rewrite the whole io module to remove all references to the collections.abc module, right? -- nosy:

[issue19219] speed up marshal.loads()

2013-10-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: Why adding ASCII strings, whereas you can add Latin1 (UCS1, U+-U+00FF) strings? Reasons: - most strings in pyc files are pure ASCII (it's like 99% in the stdlib) - unmarshalling ASCII strings is faster: you can pass 127 to PyUnicode_New without scanning

[issue19224] Make hash(None) consistent among processes

2013-10-11 Thread STINNER Victor
STINNER Victor added the comment: In the same Python version, hash(None) always give me the same value. I cannot reproduced your issue on Linux, I tested Python 2.7, 3.3 and 3.4. $ python2.7 -c print(hash(None)) 17171842026 $ python2.7 -c print(hash(None)) 17171842026 $ python2.7 -c

[issue19224] Make hash(None) consistent among processes

2013-10-11 Thread STINNER Victor
STINNER Victor added the comment: It's wired and make difficulty for distributed systems partitioning data according hash of keys if the system wants the keys support None. How you handle the randomization of hash(str)? (python2.7 -R, enabled by default in Python 3.3). --

[issue19219] speed up marshal.loads()

2013-10-11 Thread STINNER Victor
STINNER Victor added the comment: unmarshalling ASCII strings is faster: you can pass 127 to PyUnicode_New without scanning for non-ASCII chars Oh, I forgot this pain of the PEP 393. Don't tell me more, it's enough :-) -- ___ Python tracker

[issue19219] speed up marshal.loads()

2013-10-11 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: I imagine that the test for ASCII is cheaper. It corresponds to the new compact internal unicode representation (one byte characters). This looks fine. Can you quantify where the speedup comes from? Reading the code, I see we now maintain a small

[issue19219] speed up marshal.loads()

2013-10-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: This looks fine. Can you quantify where the speedup comes from? From all changes, but mainly the ASCII special-casing and the new buffering. Reading the code, I see we now maintain a small internal buffer in the file object, rather than using stack

[issue19219] speed up marshal.loads()

2013-10-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: Reading the code, I see we now maintain a small internal buffer in the file object, rather than using stack allocation at the call sites. It is unclear to me how this saves memory, since the amount of memory copying should be the same. No, memory

[issue19225] lack of PyExc_BufferError doc

2013-10-11 Thread hiroaki itoh
New submission from hiroaki itoh: http://docs.python.org/2.7/c-api/exceptions.html#standard-exceptions Python2.7 (at least 2.7.5) has PyExc_BufferError, but the document does not tell it. -- assignee: docs@python components: Documentation messages: 199458 nosy: docs@python,

[issue19219] speed up marshal.loads()

2013-10-11 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Right, in this case, memory copying is avoided. Regarding the memoing of 0, empty tuple, etc: Special opcode may still benefit because it takes only one byte. So, you save four bytes for each such case. I think it might be worth investigating.

[issue19225] lack of PyExc_BufferError doc

2013-10-11 Thread hiroaki itoh
hiroaki itoh added the comment: also: * GeneratorExit * StopIteration * VMSError (#ifdef __VMS) * UnboundLocalError * IndentationError * TabError * UnicodeError * UnicodeDecodeError * UnicodeEncodeError * UnicodeTranslateError * Warning; * UserWarning; * DeprecationWarning; *

[issue19210] Unicode Objects in Tuples

2013-10-11 Thread Martin v . Löwis
Martin v. Löwis added the comment: It's at https://mail.python.org/mailman/listinfo/python-list -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19210 ___

  1   2   >