PyDev 2.3.0 Released

2011-12-16 Thread Fabio Zadrozny
Hi All, PyDev 2.3.0 has been released Details on PyDev: http://pydev.org Details on its development: http://pydev.blogspot.com Release Highlights: --- * Pep8.py integrated (must be enabled in PyDev Editor Code Analysis pep8.py). * Faster PyDev startup (internal

HTSQL 2.2 : A Query Language for the Accidental Programmer

2011-12-16 Thread Clark C. Evans
We'd like to announce the next release of HTSQL, a high-level query language for relational databases. HTSQL is specifically designed for data analysts web developers and makes writing and maintaining complex queries a pleasure. HTSQL can be used as a command-line interpreter, a WSGI

Class: @property - .__dict__

2011-12-16 Thread Ulrich
Good morning, I wonder if someone could please help me out with the @property function as illustrated in the following example. class te(): def __init__(self): self.a = 23 @property def b(self): return 2 * self.a t = te() In [4]: t.a Out[4]: 23 In [5]: t.b Out[5]:

Re: Class: @property - .__dict__

2011-12-16 Thread Steven D'Aprano
On Fri, 16 Dec 2011 00:52:11 -0800, Ulrich wrote: Good morning, I wonder if someone could please help me out with the @property function as illustrated in the following example. class te(): def __init__(self): self.a = 23 @property def b(self): return 2 *

Re: Class: @property - .__dict__

2011-12-16 Thread Ulrich
On Dec 16, 10:03 am, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Fri, 16 Dec 2011 00:52:11 -0800, Ulrich wrote: Good morning, I wonder if someone could please help me out with the @property function as illustrated in the following example. class te():     def

Re: Class: @property - .__dict__

2011-12-16 Thread Ulrich
On Dec 16, 10:11 am, Ulrich ulrich.do...@gmail.com wrote: On Dec 16, 10:03 am, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Fri, 16 Dec 2011 00:52:11 -0800, Ulrich wrote: Good morning, I wonder if someone could please help me out with the @property function

Re: AttributeError in with statement (3.2.2)

2011-12-16 Thread Steven D'Aprano
On Thu, 15 Dec 2011 19:39:17 -0500, Terry Reedy wrote: [...] After reading your post, I think I have worked out where our disagreement lines: you think that bound methods and instance methods are not the same thing, and that a function defined inside a class is different from a function

Re: Class: @property - .__dict__

2011-12-16 Thread Peter Otten
Ulrich wrote: if I replace it to def attributelist(self): # find all attributes to the class that are of type numpy arrays: return [attr for attr in dir(self) if isinstance(getattr(self, attr), numpy.ndarray)] it crashes going into some kind of endless loop. Do you

Re: Class: @property - .__dict__

2011-12-16 Thread Thomas Rachel
Am 16.12.2011 09:52 schrieb Ulrich: Could anyone please explain me why this does not work / how to get b into .__dict__ / hint me to an explanation? b is not a data element of the particular instance, but it lives in the class. It is, roughly spoken, a kind of method, just to be used

modifying a time.struct_time

2011-12-16 Thread Ulrich Eckhardt
Hi! I'm trying to create a struct_time that is e.g. one year ahead or a month back in order to test some parsing/formatting code with different dates. Now, the straightforward approach is t = time.localtime() t.tm_year += 1 This fails with TypeError: readonly attribute. This kind-of

Re: modifying a time.struct_time

2011-12-16 Thread Mazen Harake
Hi, Easiest way is to change the time to seconds, add as many seconds as a year/month/week/day/hour/minutes represent and then transform it back. E.g. time.time() 1324031491.026137 time.time() + 3600 # Add an hour 1324035105.082003 time.gmtime(time.time() + 3600)

Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax]

2011-12-16 Thread Eelco
On Dec 16, 3:58 am, MRAB pyt...@mrabarnett.plus.com wrote: On 16/12/2011 02:14, alex23 wrote: Eelcohoogendoorn.ee...@gmail.com  wrote: To tie it back in with python language design; all the more reason not to opt for pseudo-backwards compatibility. If python wants a remainder function,

Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax]

2011-12-16 Thread Eelco
On Dec 16, 6:30 am, alex23 wuwe...@gmail.com wrote: On Dec 16, 3:01 pm, Chris Angelico ros...@gmail.com wrote: And I would be most sorry to see % renamed to mod in Python. Hello, %s! My favourite number is %d. mod (Fred,42)   # This just looks wrong. Finally we can give this operator a

Re: modifying a time.struct_time

2011-12-16 Thread Steven D'Aprano
On Fri, 16 Dec 2011 10:45:22 +0100, Ulrich Eckhardt wrote: Hi! I'm trying to create a struct_time that is e.g. one year ahead or a month back in order to test some parsing/formatting code with different dates. [...] The second approach is this: l = list(t) # convert to a sequence

Re: modifying a time.struct_time

2011-12-16 Thread Chris Angelico
On Fri, Dec 16, 2011 at 8:45 PM, Ulrich Eckhardt ulrich.eckha...@dominolaser.com wrote: I'm trying to create a struct_time that is e.g. one year ahead or a month back in order to test some parsing/formatting code with different dates. Do you need it to be one exact calendar year, or would it

Re: modifying a time.struct_time

2011-12-16 Thread Tim Golden
On 16/12/2011 10:44, Steven D'Aprano wrote: [ on time.struct_time ] Not a bug, but it does seem a very old and inelegant API more suited to hairy C programmers gathered around a smokey fire in a cave chewing on old dinosaur bones, and not worthy of space-age Python coders flying around on

GlobalLogic PYTHON/JAVA positions

2011-12-16 Thread Richa Sinha
Hi All , Trust you doing well.. GlobalLogic is looking for highly skilled *Python Developers/Sr.Developers* , *JAVA DEVELOPERS/Sr. Developers* for one of our strategic engagements with * GOOGLE. * Following are the details: *Python Developer(s)/Sr. Developers* Experience: 1-5 Yrs Min

ckjdlkfnl,ndf,nfd,fndfnkdnk mmdlssdlndnll; k; as; lkds sjdsljdlskjdsl; kdslksdl; ddlk

2011-12-16 Thread D. Mohan M. Dayalan
http;//123maza.com/48/moon670/ -- http://mail.python.org/mailman/listinfo/python-list

merging argparse parsers

2011-12-16 Thread Andrea Crotti
I would like to have something like merged_parser = LoggingParser() + OtherParser() Which should create an argument parser with all the options composed. Now for that I think I would need to subclass the argument, and something fancy with the overloading. The problem is that apparently there

RE: Localhost client-server simple ssl socket test program problems

2011-12-16 Thread Yang Chun-Kai
To: python-list@python.org From: li...@cheimes.de Subject: Re: Localhost client-server simple ssl socket test program problems Date: Thu, 15 Dec 2011 20:45:43 +0100 Am 15.12.2011 20:09, schrieb Yang Chun-Kai: Server side error: File views.py, line 17, in module connstream =

Make a small function thread safe

2011-12-16 Thread Brad Tilley
Hey guys, I have a C++ function that I'd like to replicate (as closely as possible) in Python. Here's an example: 107 void increment_counter( unsigned int counter ) 108 { 109 boost::mutex::scoped_lock lock( counter_lock ); 110 ++counter; 111

Re: Make a small function thread safe

2011-12-16 Thread Tim Wintle
On Fri, 2011-12-16 at 05:21 -0800, Brad Tilley wrote: 107 void increment_counter( unsigned int counter ) 108 { 109 boost::mutex::scoped_lock lock( counter_lock ); 110 ++counter; 111 } with counter_lock: counter += 1 ... where

Re: modifying a time.struct_time

2011-12-16 Thread Ulrich Eckhardt
Am 16.12.2011 10:45, schrieb Ulrich Eckhardt: I'm trying to create a struct_time that is e.g. one year ahead or a month back in order to test some parsing/formatting code with different dates. There is something I stumbled across that helps and that is the datetime module, which seems more

Re: Make a small function thread safe

2011-12-16 Thread Brad Tilley
On Fri, Dec 16, 2011 at 8:33 AM, Tim Wintle tim.win...@teamrubber.comwrote: On Fri, 2011-12-16 at 05:21 -0800, Brad Tilley wrote: 107 void increment_counter( unsigned int counter ) 108 { 109 boost::mutex::scoped_lock lock( counter_lock ); 110

Re: modifying a time.struct_time

2011-12-16 Thread Chris Angelico
On Sat, Dec 17, 2011 at 12:32 AM, Ulrich Eckhardt ulrich.eckha...@dominolaser.com wrote: Concerning the idea to use seconds, I'd rather not, because already the number of seconds per minute ranges from 60 to 62, and it doesn't get better with things like months (28...31 days), years (365...366

Re: Make a small function thread safe

2011-12-16 Thread Brad Tilley
On Fri, Dec 16, 2011 at 9:24 AM, Brad Tilley kj4...@gmail.com wrote: On Fri, Dec 16, 2011 at 8:33 AM, Tim Wintle tim.win...@teamrubber.comwrote: On Fri, 2011-12-16 at 05:21 -0800, Brad Tilley wrote: 107 void increment_counter( unsigned int counter ) 108 { 109

Re: Make a small function thread safe

2011-12-16 Thread Tim Wintle
On Fri, 2011-12-16 at 09:24 -0500, Brad Tilley wrote: So something like this then: import threading shared_container = [] lock = threading.Lock() class thread_example( threading.Thread ): def __init__( self ): threading.Thread.__init__ (self) def run(t):

Re: ERP with Supply chain management (incl. POS) and Customer relationship management ??? What's available?

2011-12-16 Thread Grant Edwards
On 2011-12-16, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: On Thu, Dec 15, 2011 at 5:54 AM, Anurag Chourasia anurag.choura...@gmail.com wrote: I am building a POS/CRM (Loyalty Management) system as well. Is it just me, or does the phrase Loyalty Management have a faintly ominous ring

Re: Make a small function thread safe

2011-12-16 Thread Brad Tilley
On Dec 16, 9:36 am, Tim Wintle tim.win...@teamrubber.com wrote: should be:       def run(t):           with lock:               shared_container.append(t.name) (or lock.acquire() and lock.release() as you mentioned) Thanks Tim. The with statement is closer to the C++ code (IMO) more so

Re: ERP with Supply chain management (incl. POS) and Customer relationship management — What's available?

2011-12-16 Thread Emile van Sebille
On 12/15/2011 6:43 AM Alec Taylor said... On Thu, Dec 15, 2011 at 5:54 AM, Anurag Chourasia anurag.choura...@gmail.com wrote: Hi Alec, I am building a POS/CRM (Loyalty Management) system as well. So far, the best I could find to use as a base OpenERP? Emile --

Re: Class: @property - .__dict__

2011-12-16 Thread Ian Kelly
On Fri, Dec 16, 2011 at 2:32 AM, Peter Otten __pete...@web.de wrote: Ulrich wrote: if I replace it to def attributelist(self):          # find all attributes to the class that are of type numpy arrays:          return [attr for attr in dir(self) if isinstance(getattr(self, attr),

re.sub(): replace longest match instead of leftmost match?

2011-12-16 Thread John Gordon
According to the documentation on re.sub(), it replaces the leftmost matching pattern. However, I want to replace the *longest* matching pattern, which is not necessarily the leftmost match. Any suggestions? I'm working with IPv6 CIDR strings, and I want to replace the longest match of

Re: re.sub(): replace longest match instead of leftmost match?

2011-12-16 Thread Devin Jeanpierre
You could use re.finditer to find the longest match, and then replace it manually by hand (via string slicing). (a match is the longest if (m.end() - m.start()) is the largest -- so, max(re.finditer(...), key=lambda m: (m.end() = m.start())) -- Devin P.S. does anyone else get bothered by how

Re: re.sub(): replace longest match instead of leftmost match?

2011-12-16 Thread MRAB
On 16/12/2011 16:49, John Gordon wrote: According to the documentation on re.sub(), it replaces the leftmost matching pattern. However, I want to replace the *longest* matching pattern, which is not necessarily the leftmost match. Any suggestions? I'm working with IPv6 CIDR strings, and I

Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax]

2011-12-16 Thread rusi
On Dec 16, 3:25 pm, Eelco hoogendoorn.ee...@gmail.com wrote: Pseudo-backwards compatibility with other languages, I couldnt not care less for. Double negations n Goedelian situations have interesting implications (tho here its triple) -- http://mail.python.org/mailman/listinfo/python-list

Making the case for typed lists/iterators in python

2011-12-16 Thread Nathan Rice
I realize this has been discussed in the past, I hope that I am presenting a slightly different take on the subject that will prove interesting. This is primarily motivated by my annoyance with using comprehensions in certain circumstances. Currently, if you want to perform successive

Re: re.sub(): replace longest match instead of leftmost match?

2011-12-16 Thread Ian Kelly
On Fri, Dec 16, 2011 at 10:36 AM, MRAB pyt...@mrabarnett.plus.com wrote: On 16/12/2011 16:49, John Gordon wrote: According to the documentation on re.sub(), it replaces the leftmost matching pattern. However, I want to replace the *longest* matching pattern, which is not necessarily the

Re: Python Interpreter Error with PyDev (Eclipse IDE)

2011-12-16 Thread Fabio Zadrozny
It seems you have a version of Python 2.5 in your system and when starting up Python 3.2.2 it's getting things from 2.5 (this would probably also happen on the command line). The usual suspect is that you defined a PYTHONROOT variable which is pointing to Python 2.5 and not to the python you're

Re: re.sub(): replace longest match instead of leftmost match?

2011-12-16 Thread Ian Kelly
On Fri, Dec 16, 2011 at 10:57 AM, Ian Kelly ian.g.ke...@gmail.com wrote: On Fri, Dec 16, 2011 at 10:36 AM, MRAB pyt...@mrabarnett.plus.com wrote: On 16/12/2011 16:49, John Gordon wrote: According to the documentation on re.sub(), it replaces the leftmost matching pattern. However, I want to

Re: Making the case for typed lists/iterators in python

2011-12-16 Thread Roy Smith
In article mailman.3739.1324057724.27778.python-l...@python.org, Nathan Rice nathan.alexander.r...@gmail.com wrote: I'd like to hear people's thoughts on the subject. Currently we are throwing away useful information in many cases that could be used for code analysis, optimization and

Re: re.sub(): replace longest match instead of leftmost match?

2011-12-16 Thread MRAB
On 16/12/2011 17:57, Ian Kelly wrote: On Fri, Dec 16, 2011 at 10:36 AM, MRABpyt...@mrabarnett.plus.com wrote: On 16/12/2011 16:49, John Gordon wrote: According to the documentation on re.sub(), it replaces the leftmost matching pattern. However, I want to replace the *longest* matching

Re: Making the case for typed lists/iterators in python

2011-12-16 Thread Stefan Behnel
Nathan Rice, 16.12.2011 18:48: I realize this has been discussed in the past, I hope that I am presenting a slightly different take on the subject that will prove interesting. This is primarily motivated by my annoyance with using comprehensions in certain circumstances. Currently, if you want

Re: Making the case for typed lists/iterators in python

2011-12-16 Thread Chris Angelico
On Sat, Dec 17, 2011 at 5:05 AM, Roy Smith r...@panix.com wrote: Most of this was TL:DNR, but I will admit I often wish for a better way to log intermediate values.  For example, a common pattern in the code I'm working with now is functions that end in:   return [Foo(x) for x in

Re: Making the case for typed lists/iterators in python

2011-12-16 Thread Arnaud Delobelle
On 16 December 2011 18:25, Chris Angelico ros...@gmail.com wrote: tee = lambda func,arg: (func(arg),arg)[1] What a strange way to spell it! def tee(func, arg): func(arg) return arg -- Arnaud -- http://mail.python.org/mailman/listinfo/python-list

Re: re.sub(): replace longest match instead of leftmost match?

2011-12-16 Thread Roy Smith
In article jcfsrk$skh$1...@reader1.panix.com, John Gordon gor...@panix.com wrote: I'm working with IPv6 CIDR strings, and I want to replace the longest match of (:|$)+ with :. But when I use re.sub() it replaces the leftmost match, even if there is a longer match later in the string.

Re: Making the case for typed lists/iterators in python

2011-12-16 Thread Chris Angelico
On Sat, Dec 17, 2011 at 5:38 AM, Arnaud Delobelle arno...@gmail.com wrote: On 16 December 2011 18:25, Chris Angelico ros...@gmail.com wrote: tee = lambda func,arg: (func(arg),arg)[1] What a strange way to spell it! def tee(func, arg):    func(arg)    return arg I started with that

Re: Making the case for typed lists/iterators in python

2011-12-16 Thread Nathan Rice
Nothing stops me from implementing it, in fact it is VERY trivial to wrap member class methods onto a list subclass, and wrap functions to support vectorized behavior. The problem is that as soon as you hit anything outside your code that returns a list or iterator, everything gets blown away

Re: Making the case for typed lists/iterators in python

2011-12-16 Thread Devin Jeanpierre
2. One comprehension: L2 = [Z(X(Y(e))) for e in L1] or L2 = [e.X().Y().Z() for e in L1] I want to say that maybe this is better done by functions like map() (although, Python is missing a composition operator which might be handy, and mapping method calls isn't pretty). I don't know that it

Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax]

2011-12-16 Thread Eelco
On 16 dec, 18:38, rusi rustompm...@gmail.com wrote: On Dec 16, 3:25 pm, Eelco hoogendoorn.ee...@gmail.com wrote: Pseudo-backwards compatibility with other languages, I couldnt not care less for. Double negations n Goedelian situations have interesting implications (tho here its triple)

Re: Making the case for typed lists/iterators in python

2011-12-16 Thread Mel Wilson
Chris Angelico wrote: It's no more strange than the way some people omit the u from colour. :) Bonum Petronio Arbiteri, bonum mihi. Mel. -- http://mail.python.org/mailman/listinfo/python-list

Re: Making the case for typed lists/iterators in python

2011-12-16 Thread Stefan Behnel
Nathan Rice, 16.12.2011 19:51: Nothing stops me from implementing it, in fact it is VERY trivial to wrap member class methods onto a list subclass, and wrap functions to support vectorized behavior. The problem is that as soon as you hit anything outside your code that returns a list or

Re: Making the case for typed lists/iterators in python

2011-12-16 Thread Ben Finney
Roy Smith r...@panix.com writes: When something goes amiss and I want to debug the problem, I often transform that into: temp = [Foo(x) for x in bunch_of_x_thingies] logger.debug(temp) return temp It would be convenient to be able to get at and log the intermediate value

Re: Make a small function thread safe

2011-12-16 Thread Tim Delaney
On 17 December 2011 02:05, Brad Tilley kj4...@gmail.com wrote: On Dec 16, 9:36 am, Tim Wintle tim.win...@teamrubber.com wrote: should be: def run(t): with lock: shared_container.append(t.name) (or lock.acquire() and lock.release() as you mentioned)

Re: re.sub(): replace longest match instead of leftmost match?

2011-12-16 Thread John Gordon
In mailman.3737.1324054637.27778.python-l...@python.org Devin Jeanpierre jeanpierr...@gmail.com writes: You could use re.finditer to find the longest match, and then replace it manually by hand (via string slicing). (a match is the longest if (m.end() - m.start()) is the largest -- so,

Re: re.sub(): replace longest match instead of leftmost match?

2011-12-16 Thread John Gordon
In mailman.3742.1324058429.27778.python-l...@python.org Ian Kelly ian.g.ke...@gmail.com writes: I'm also looking for a regexp that will remove leading zeroes in each four-digit group, but will leave a single zero if the group was all zeroes. pattern = r'\b0{1,3}([1-9a-f][0-9a-f]*|0)\b'

Re: re.sub(): replace longest match instead of leftmost match?

2011-12-16 Thread John Gordon
In roy-7c4e8a.13361716122...@news.panix.com Roy Smith r...@panix.com writes: Having done quite a bit of IPv6 work, my opinion here is that you're trying to do The Wrong Thing. What you want is an IPv6 class which represents an address in some canonical form. It would have constructors

Re: re.sub(): replace longest match instead of leftmost match?

2011-12-16 Thread MRAB
On 16/12/2011 21:04, John Gordon wrote: Inmailman.3737.1324054637.27778.python-l...@python.org Devin Jeanpierrejeanpierr...@gmail.com writes: You could use re.finditer to find the longest match, and then replace it manually by hand (via string slicing). (a match is the longest if

Re: AttributeError in with statement (3.2.2)

2011-12-16 Thread Terry Reedy
On 12/16/2011 4:22 AM, Steven D'Aprano wrote: On Thu, 15 Dec 2011 19:39:17 -0500, Terry Reedy wrote: [...] After reading your post, I think I have worked out where our disagreement lines: you think that bound methods and instance methods are not the same thing, Do you agree that an unbound

Re: Make a small function thread safe

2011-12-16 Thread Lie Ryan
On 12/17/2011 01:30 AM, Brad Tilley wrote: Or perhaps run should look like this instead: def run(t): lock.acquire() shared_container.append(t.name http://t.name) lock.release() That seems a bit barbaric to me, not sure. change that to: def run(t): with

Re: Making the case for typed lists/iterators in python

2011-12-16 Thread Terry Reedy
On 12/16/2011 1:05 PM, Roy Smith wrote: I'm working with now is functions that end in: return [Foo(x) for x in bunch_of_x_thingies] When something goes amiss and I want to debug the problem, I often transform that into: temp = [Foo(x) for x in bunch_of_x_thingies]

Re: re.sub(): replace longest match instead of leftmost match?

2011-12-16 Thread Terry Reedy
On 12/16/2011 1:36 PM, Roy Smith wrote: What you want is an IPv6 class which represents an address in some canonical form. It would have constructors which accept any of the RFC-2373 defined formats. It would also have string formatting methods to convert the internal form into any of these

Re: Python Interpreter Error with PyDev (Eclipse IDE)

2011-12-16 Thread Joshua Jodrey
Thanks Fabio! I looked at my environment variables, and the only one python related was PYTHONHOME, and that was set to C:\csvn\Python25.  So I changed that to C:\Python32\ and I added an environment variable for PYTHONROOT and set that to the same value.  It now seems to work! I must have had

Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax]

2011-12-16 Thread Gregory Ewing
Eelco wrote: the actual english usage of the phrase, which omits the negation completely :). (I could care less) No, that's the American usage. The English usage is I couldn't care less, which has the advantage of actually making sense. -- Greg --

Re: AttributeError in with statement (3.2.2)

2011-12-16 Thread Ethan Furman
Terry Reedy wrote: On 12/16/2011 4:22 AM, Steven D'Aprano wrote: On Thu, 15 Dec 2011 19:39:17 -0500, Terry Reedy wrote: [...] After reading your post, I think I have worked out where our disagreement lies: you think that bound methods and instance methods are not the same thing, Do you agree

Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax]

2011-12-16 Thread Eelco
On Dec 17, 12:49 am, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: Eelco wrote: the actual english usage of the phrase, which omits the negation completely :). (I could care less) No, that's the American usage. The English usage is I couldn't care less, which has the advantage of

Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax]

2011-12-16 Thread Roy Smith
In article 2420abd7-7d91-4bc9-bb3b-d8ec1680e...@u32g2000yqe.googlegroups.com, Eelco hoogendoorn.ee...@gmail.com wrote: And yes, I agree; 'I couldnt care less' makes much more sense. 'I could care less' can only make sense if you interpret it sarcastically, as if omitting an 'oh wait, I

Re: AttributeError in with statement (3.2.2)

2011-12-16 Thread Ethan Furman
Ethan Furman wrote: Terry Reedy wrote: On 12/16/2011 4:22 AM, Steven D'Aprano wrote: On Thu, 15 Dec 2011 19:39:17 -0500, Terry Reedy wrote: [...] After reading your post, I think I have worked out where our disagreement lies: you think that bound methods and instance methods are not the

Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax]

2011-12-16 Thread Steven D'Aprano
On Fri, 16 Dec 2011 11:40:11 -0800, Eelco wrote: On 16 dec, 18:38, rusi rustompm...@gmail.com wrote: On Dec 16, 3:25 pm, Eelco hoogendoorn.ee...@gmail.com wrote: Pseudo-backwards compatibility with other languages, I couldnt not care less for. Double negations n Goedelian situations have

Re: AttributeError in with statement (3.2.2)

2011-12-16 Thread Steven D'Aprano
On Fri, 16 Dec 2011 17:05:57 -0500, Terry Reedy wrote: On 12/16/2011 4:22 AM, Steven D'Aprano wrote: On Thu, 15 Dec 2011 19:39:17 -0500, Terry Reedy wrote: [...] After reading your post, I think I have worked out where our disagreement lines: you think that bound methods and instance methods

Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax]

2011-12-16 Thread David Robinow
On Fri, Dec 16, 2011 at 7:54 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Fri, 16 Dec 2011 11:40:11 -0800, Eelco wrote: On 16 dec, 18:38, rusi rustompm...@gmail.com wrote: On Dec 16, 3:25 pm, Eelco hoogendoorn.ee...@gmail.com wrote: Pseudo-backwards compatibility with

Re: Make a small function thread safe

2011-12-16 Thread John Nagle
On 12/16/2011 2:08 PM, Lie Ryan wrote: On 12/17/2011 01:30 AM, Brad Tilley wrote: Or perhaps run should look like this instead: def run(t): lock.acquire() shared_container.append(t.name http://t.name) lock.release() That seems a bit barbaric to me, not sure. change that to: def run(t):

root[:]=[root,root]

2011-12-16 Thread YAN HUA
Hi,all. Could anybody tell how this code works? root = [None, None] root[:] = [root, root] root [[...], [...]] root[0] [[...], [...]] root[0][0][1][1][0][0][0][1][1] [[...], [...]] Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: AttributeError in with statement (3.2.2)

2011-12-16 Thread Steven D'Aprano
On Fri, 16 Dec 2011 15:26:30 -0800, Ethan Furman wrote: Terry Reedy wrote: On 12/16/2011 4:22 AM, Steven D'Aprano wrote: [...] I think you two are in violent agreement as far as how Python is functioning, and the conflict is in the names given to the various pieces... I think a glossary

Re: root[:]=[root,root]

2011-12-16 Thread Lie Ryan
On 12/17/2011 01:40 PM, YAN HUA wrote: Hi,all. Could anybody tell how this code works? root = [None, None] First, you're creating a list of two None, let's say it's list-1. Then you bind the name 'root' to list-1. root[:] = [root, root] Next, you assign list-1's first member with

[issue13609] Add os.get_terminal_size() function

2011-12-16 Thread Zbyszek Szmek
Zbyszek Szmek zbys...@in.waw.pl added the comment: The patch is already almost there (in #13041). I'll post an updated version here in a moment. -- nosy: +zbysz ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13609

[issue13611] Integrate ElementC14N module into xml.etree package

2011-12-16 Thread Stefan Behnel
New submission from Stefan Behnel sco...@users.sourceforge.net: The ElementC14N.py module by Fredrik Lundh implements XML canonicalisation for the ElementTree serialiser. Given that the required API hooks to use it are already in xml.etree.ElementTree, this would make a nice, simple and

[issue13611] Integrate ElementC14N module into xml.etree package

2011-12-16 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +flox ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13611 ___ ___ Python-bugs-list mailing list

[issue11900] 2.7.1 unicode subclasses not calling __str__() for print statement

2011-12-16 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: However, it is a real change from 2.6 to 2.7 that breaks code. John, this issue is not the same as the one above. The difference between Python 2.6 and Python 2.7.2 you mention only applies to % formatting. The change is clearly

[issue7652] Merge C version of decimal into py3k.

2011-12-16 Thread Stefan Krah
Stefan Krah stefan-use...@bytereef.org added the comment: For my part, a two-lines description of the purpose of file is enough. OK, I'll go for small comments in the files themselves and put big ones in separate files. -- ___ Python tracker

[issue6715] xz compressor support

2011-12-16 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Is there any reason why this issue is still open? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6715 ___

[issue13612] xml.etree.ElementTree says unknown encoding of a regular encoding

2011-12-16 Thread Dongying Zhang
New submission from Dongying Zhang zhangdongying1...@gmail.com: I've been trying to parse xml string using python, codes following: #-*- coding: utf-8 -*- import xml.etree.ElementTree as xmlet s = '?xml version=1.0 encoding=GBK?info/info' xmlet.fromstring(s) Then: $

[issue13612] xml.etree.ElementTree says unknown encoding of a regular encoding

2011-12-16 Thread Dongying Zhang
Changes by Dongying Zhang zhangdongying1...@gmail.com: -- versions: +3rd party ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13612 ___ ___

[issue13612] xml.etree.ElementTree says unknown encoding of a regular encoding

2011-12-16 Thread Dongying Zhang
Changes by Dongying Zhang zhangdongying1...@gmail.com: -- type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13612 ___ ___

[issue1559549] ImportError needs attributes for module and file name

2011-12-16 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: fullname is technically wrong: import logging.bar Traceback (most recent call last): File stdin, line 1, in module ImportError: No module named 'bar' module_name sounds fine and explicit enough to me. Also, as Eric points out, there are many

[issue11379] Remove lightweight from minidom description

2011-12-16 Thread Stefan Behnel
Stefan Behnel sco...@users.sourceforge.net added the comment: I started a mailing list thread on the same topic: http://thread.gmane.org/gmane.comp.python.devel/127963 Especially see http://thread.gmane.org/gmane.comp.python.devel/127963/focus=128162 where I extract a proposal from the

[issue6715] xz compressor support

2011-12-16 Thread Nadeem Vawda
Nadeem Vawda nadeem.va...@gmail.com added the comment: Yes, almost half of the buildbots still don't have the xz-utils headers installed, and thus are not building/testing the lzma module. I've kept the issue open as a reminder to myself to follow up on this. --

[issue1785] inspect gets broken by some descriptors

2011-12-16 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Updated patch for 3.2. -- stage: - patch review versions: +Python 3.2 -Python 2.6 Added file: http://bugs.python.org/file23975/inspect-and-pydoc-bug2.patch ___ Python tracker rep...@bugs.python.org

[issue1785] inspect gets broken by some descriptors

2011-12-16 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Updated patch that adds a test for classifying builtin types (checks that ``inspect.classify_class_attrs(type)`` does not throw as in issue13581). -- ___ Python tracker rep...@bugs.python.org

[issue1785] inspect gets broken by some descriptors

2011-12-16 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Added file: http://bugs.python.org/file23976/inspect-and-pydoc-bug3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1785 ___

[issue12809] Missing new setsockopts in Linux (eg: IP_TRANSPARENT)

2011-12-16 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +neologix ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12809 ___ ___ Python-bugs-list mailing

[issue13610] On Python parsing numbers.

2011-12-16 Thread Charles-François Natali
Charles-François Natali neolo...@free.fr added the comment: Can this be fixed? More or less. The following patch does the trick, but is not really elegant: --- a/Parser/tokenizer.c2011-06-01 02:39:38.0 + +++ b/Parser/tokenizer.c2011-12-16 08:48:45.0 +

[issue6695] PyXXX_ClearFreeList for dict, set, and list

2011-12-16 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 57f0af61da53 by Antoine Pitrou in branch 'default': Issue #6695: Full garbage collection runs now clear the freelist of set objects. http://hg.python.org/cpython/rev/57f0af61da53 -- nosy: +python-dev

[issue6695] PyXXX_ClearFreeList for dict, set, and list

2011-12-16 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: The clearing the dict and list freelists has been added independently, so I committed the part of the patch pertaining to sets. Thank you! -- resolution: - fixed stage: - committed/rejected status: open - closed versions: +Python 3.3

[issue11379] Remove lightweight from minidom description

2011-12-16 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: xml.dom.minidom is a [-XXX: light-weight] implementation of the Document Object Model interface. This is ok. It is intended to be simpler than the full DOM and also [+XXX: provide a] significantly smaller [+XXX: API]. Doesn't simpler

[issue5424] Packed IPaddr conversion tests should be extended

2011-12-16 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +neologix ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5424 ___ ___ Python-bugs-list mailing

[issue13612] xml.etree.ElementTree says unknown encoding of a regular encoding

2011-12-16 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Actually, this fails on 2.6 and 2.7 on wide unicode builds, and passes with narrow unicode builds (on my 64bit Linux box). In pyexpat.c, PyUnknownEncodingHandler accesses 256 characters of a unicode buffer, without checking its

[issue13609] Add os.get_terminal_size() function

2011-12-16 Thread Denilson Figueiredo de Sá
Denilson Figueiredo de Sá denilso...@gmail.com added the comment: Zbyszek, I just looked at [1] and I disagree that the environment variable should have higher precedence. In fact, I believe it should have lower precedence, and should be used as a fallback. [1]:

[issue10350] errno is read too late

2011-12-16 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 6a966179c73a by Antoine Pitrou in branch '3.2': Issue #10350: Read and save errno before calling a function which might overwrite it. http://hg.python.org/cpython/rev/6a966179c73a New changeset 8e0b2e75ca7a by

[issue10350] errno is read too late

2011-12-16 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Committed in 3.x. I won't bother backporting to 2.x. Thank you! -- resolution: - fixed stage: patch review - committed/rejected status: open - closed versions: +Python 3.3 -Python 2.7, Python 3.1 ___

[issue9975] Incorrect use of flowinfo and scope_id in IPv6 sockaddr tuple

2011-12-16 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +neologix ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9975 ___ ___ Python-bugs-list mailing

  1   2   >