Re: [Python-Dev] cpython (3.2): Fix #11583. Changed os.path.isdir to use GetFileAttributes instead of os.stat.

2011-06-08 Thread Georg Brandl
On 06/09/11 02:00, brian.curtin wrote: > http://hg.python.org/cpython/rev/88e318166eaf > changeset: 70713:88e318166eaf > branch: 3.2 > parent: 70700:0aa3064d1cef > user:Brian Curtin > date:Wed Jun 08 18:17:18 2011 -0500 > summary: > Fix #11583. Changed os.path.isdir t

Re: [Python-Dev] The socket HOWTO

2011-06-08 Thread Eli Bendersky
On Wed, Jun 8, 2011 at 21:07, geremy condra wrote: > On Tue, Jun 7, 2011 at 10:37 AM, Eli Bendersky wrote: > > > > Just be careful not to reproduce http://www.apress.com/9781590593714 :-) > > These things tend to get out of hand very quickly. > > You say that like it's a bad thing. The first few

Re: [Python-Dev] Can we improve support for abstract base classes with desciptors

2011-06-08 Thread Nick Coghlan
On Thu, Jun 9, 2011 at 8:51 AM, Darren Dale wrote: > That should be "get_abstract_names(namespace)", since ns.items() gets > called again in the for loop. I think the get_abstract_names function > isn't needed though, since it is only ever called that one time. Any > reason not replace the above b

Re: [Python-Dev] fatal error callback issue

2011-06-08 Thread Terry Reedy
On 6/8/2011 3:30 PM, Tom Whittock wrote: I'm writing in regards to http://bugs.python.org/issue1195571 I'm embedding Python in my application and ran into a need for this functionality. I wrote a similar patch myself, and was about to submit it. When I searched for similar issues I found that th

Re: [Python-Dev] [Python-checkins] cpython (2.7): Merge

2011-06-08 Thread Victor Stinner
Le jeudi 09 juin 2011 à 02:30 +0200, brian.curtin a écrit : > http://hg.python.org/cpython/rev/f1509fc75435 > changeset: 70715:f1509fc75435 > branch: 2.7 > parent: 70661:6e7a98cfcfab > user:Brian Curtin > date:Wed Jun 08 19:29:53 2011 -0500 > summary: > Merge FYI thi

Re: [Python-Dev] Can we improve support for abstract base classes with desciptors

2011-06-08 Thread Darren Dale
On Wed, Jun 8, 2011 at 11:55 AM, Nick Coghlan wrote: > On Thu, Jun 9, 2011 at 1:01 AM, Darren Dale wrote: > [snip excellent analysis of the problem] > > I have some suggestions regarding a few details of your current code, > but your basic proposal looks sound to me. > > I would tweak __new__ alo

[Python-Dev] fatal error callback issue

2011-06-08 Thread Tom Whittock
I'm writing in regards to http://bugs.python.org/issue1195571 I'm embedding Python in my application and ran into a need for this functionality. I wrote a similar patch myself, and was about to submit it. When I searched for similar issues I found that this one has been available since 2005. I'd

Re: [Python-Dev] The socket HOWTO

2011-06-08 Thread geremy condra
On Tue, Jun 7, 2011 at 10:37 AM, Eli Bendersky wrote: > > Just be careful not to reproduce http://www.apress.com/9781590593714 :-) > These things tend to get out of hand very quickly. You say that like it's a bad thing. The first few chapters of that would make a great replacement for the howto.

Re: [Python-Dev] Can we improve support for abstract base classes with desciptors

2011-06-08 Thread Nick Coghlan
On Thu, Jun 9, 2011 at 1:01 AM, Darren Dale wrote: [snip excellent analysis of the problem] I have some suggestions regarding a few details of your current code, but your basic proposal looks sound to me. I would tweak __new__ along the following lines though: def __new__(mcls, name, bases,

Re: [Python-Dev] cpython: Remove some extraneous parentheses and swap the comparison order to

2011-06-08 Thread R. David Murray
On Wed, 08 Jun 2011 21:04:48 +1000, Steven D'Aprano wrote: > Terry Reedy wrote: > > On 6/7/2011 5:35 PM, David Malcolm wrote: > > > >> I know that this style is unpopular, but if it helps, try mentally > >> pronouncing "==" in C as "is the value of". > >> > >> In this example, when I read that

Re: [Python-Dev] cpython: Remove some extraneous parentheses and swap the comparison order to

2011-06-08 Thread Alexander Belopolsky
On Wed, Jun 8, 2011 at 7:04 AM, Steven D'Aprano wrote: .. >> Whereas I read it as 'has the value' (or just 'is' ;=). > > Am I the only one who reads == as "equals"? If you are, you are the only one who reads it correctly. Consider >>> a = 2 >>> a == 2.0 True

Re: [Python-Dev] cpython: Remove some extraneous parentheses and swap the comparison order to

2011-06-08 Thread Nick Coghlan
On Wed, Jun 8, 2011 at 7:35 AM, David Malcolm wrote: > After ~12 years of doing this, it comes naturally.  I appreciate that > this may come across as weird though :) I actually thought Brett's rationale in the checkin comment was reasonable (if you get in the habit of putting constants on the le

Re: [Python-Dev] The socket HOWTO

2011-06-08 Thread Nick Coghlan
On Tue, Jun 7, 2011 at 1:54 PM, Glyph Lefkowitz wrote: > how is UDP different from TCP? > > The phrase "UDP" never appears in the HOWTO.  DGRAM sockets get a brief > mention as "anything else" in the sentence: "... you’ll get better behavior > and performance from a STREAM socket than anything els

Re: [Python-Dev] The socket HOWTO

2011-06-08 Thread Nick Coghlan
On Wed, Jun 8, 2011 at 3:37 AM, Eli Bendersky wrote: > Just be careful not to reproduce http://www.apress.com/9781590593714 :-) > These things tend to get out of hand very quickly. At the level Glyph and Martin are talking about, you're more likely to end up with http://authors.phptr.com/tanenbau

[Python-Dev] Can we improve support for abstract base classes with desciptors

2011-06-08 Thread Darren Dale
I would like to try to address some shortfalls with the way python deals with abstract base classes containing descriptors. I originally was just concerned with improving support for defining abstract properties with the decorator syntax and converting between abstract and concrete properties, but

Re: [Python-Dev] cpython: Remove some extraneous parentheses and swap the comparison order to

2011-06-08 Thread Steven D'Aprano
Terry Reedy wrote: On 6/7/2011 5:35 PM, David Malcolm wrote: I know that this style is unpopular, but if it helps, try mentally pronouncing "==" in C as "is the value of". In this example, when I read that line, my mind is thinking: "if 'u' is the value of typecode" After ~12 years of