Re: [Python-Dev] Declaring setters with getters

2007-11-02 Thread Duncan Booth
Greg Ewing <[EMAIL PROTECTED]> wrote:

> Fred Drake wrote:
>>@property
>>def attribute(self):
>>return 42
>> 
>>@property.set
>>def attribute(self, value):
>>self._ignored = value
> 
> Hmmm... if you were allowed general lvalues as the target of a
> def, you could write that as
> 
>def attribute.set(self, value):
>  ...
> 
Dotted names would be sufficient rather than general lvalues.

I like this, I think it looks cleaner than the other options, especially if 
you write both getter and setter in the same style:

attribute = property()

def attribute.fget(self):
return 42

def attribute.fset(self, value):
self._ignored = value


___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Declaring setters with getters

2007-11-02 Thread Guido van Rossum
On 11/2/07, Duncan Booth <[EMAIL PROTECTED]> wrote:
> Greg Ewing <[EMAIL PROTECTED]> wrote:
>
> > Fred Drake wrote:
> >>@property
> >>def attribute(self):
> >>return 42
> >>
> >>@property.set
> >>def attribute(self, value):
> >>self._ignored = value
> >
> > Hmmm... if you were allowed general lvalues as the target of a
> > def, you could write that as
> >
> >def attribute.set(self, value):
> >  ...
> >
> Dotted names would be sufficient rather than general lvalues.
>
> I like this, I think it looks cleaner than the other options, especially if
> you write both getter and setter in the same style:
>
> attribute = property()
>
> def attribute.fget(self):
> return 42
>
> def attribute.fset(self, value):
> self._ignored = value

Sorry, you have just entered Python 4000 territory.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Request for inclusion in 2.5.2 (5-for-1)

2007-11-02 Thread Guido van Rossum
On 10/31/07, Mike Klaas <[EMAIL PROTECTED]> wrote:
> Issue http://bugs.python.org/issue1663329 details an annoyance in the
> subprocess module that has affected several users, including me.
> Essentially, closing hundreds of thousands of file descriptors by
> round-tripping through the python exception machinery is very slow,
> taking hundreds of milliseconds and at times many seconds.  The
> proposed fix is to write this loop in c.  The c function is but a
> handful of lines long.  I purposefully kept the implementation
> trivial so that it will work on all unix variants (there is another
> issue that contains a super-duper optimization for AIX, and other
> possibilities exist for Solaris, but the simple fix yields a ten-fold
> speedup everywhere but windows, so I didn't think that it was worth
> the complexity).
>
> Though technically relating only to performance, I consider this a
> bug-fix candidate as mysterious multi-second delays when launching a
> subprocess end up making the functionality of close_fds unusable on
> some platform configurations (namely, those with high MAX_FD set).
>
> It would be great to see this is 2.5.2.  Understanding that issue
> evaluation takes significant effort, I've done some evaluation/triage
> on other open tickets:

Thanks for doing these!

Since people are already jumping on those bugs but nobody has voiced
an opinion on your own patch, let me say that I think it's a good
patch, and I want it in 2.6, but I'm reluctant to add it to 2.5.2 as
it goes well beyond a bugfix (adding a new C API and all that).

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Request for inclusion in 2.5.2 (5-for-1)

2007-11-02 Thread Nick Coghlan
Mike Klaas wrote:
> http://bugs.python.org/issue1705170:  reproduced.  Conjecture as to  
> why it is occurring, but I don't know the guts well enough to propose  
> a decent fix.

I've fixed this on the trunk (I'm afraid I have no opinion on the patch 
you're interested in though.

Neal - where does the 2.5 branch stand at the moment? This would be a 
simple fix to slip into 2.5.2 if there's still time.

Cheers,
Nick.

-- 
Nick Coghlan   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---
 http://www.boredomandlaziness.org
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Request for inclusion in 2.5.2 (5-for-1)

2007-11-02 Thread Mike Klaas
On 2-Nov-07, at 6:57 AM, Guido van Rossum wrote:

>
> Since people are already jumping on those bugs but nobody has voiced
> an opinion on your own patch, let me say that I think it's a good
> patch, and I want it in 2.6, but I'm reluctant to add it to 2.5.2 as
> it goes well beyond a bugfix (adding a new C API and all that).

Thanks for looking at it!

Is there a better way of exposing some c-helper code for a stdlib  
module written in python?  It seems that the canonical pattern is to  
write a separate extension module called _ and import the  
functionality from there, but that seemed like a significantly more  
invasive patch.

Might it help to tack on the helper function in posix only, deleting  
it from the os namespace?

Thanks again,
-Mike

___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] Summary of Tracker Issues

2007-11-02 Thread Tracker

ACTIVITY SUMMARY (10/26/07 - 11/02/07)
Tracker at http://bugs.python.org/

To view or respond to any of the issues listed below, click on the issue 
number.  Do NOT respond to this message.


 1315 open (+15) / 11541 closed (+21) / 12856 total (+36)

Open issues with patches:   417

Average duration of open issues: 683 days.
Median duration of open issues: 775 days.

Open Issues Breakdown
   open  1311 (+15)
pending 4 ( +0)

Issues Created Or Reopened (36)
___

pickling bytes?  10/26/07
   http://bugs.python.org/issue1338created  gvanrossum   
   py3k

smtplib starttls() should ehlo() if it needs to  10/26/07
   http://bugs.python.org/issue1339created  fenner   
   

correction for test_tempfile in py3k on Windows  10/28/07
CLOSED http://bugs.python.org/issue1340reopened gvanrossum   
   

correction for test_fileinput in py3k on Windows 10/26/07
CLOSED http://bugs.python.org/issue1341created  amaury.forgeotdarc   
   patch   

Crash on Windows if Python runs from a directory with umlauts10/27/07
   http://bugs.python.org/issue1342created  tiran
   

XMLGenerator: nice  elements 10/27/07
   http://bugs.python.org/issue1343created  panzi
   

subprocess.communication doc could use clarification 10/27/07
   http://bugs.python.org/issue1344created  dsturtevant  
   

Fix for test_netrc on Windows10/27/07
   http://bugs.python.org/issue1345created  tiran
   patch   

Error using >>> from OpenGL.GLUT import *10/27/07
CLOSED http://bugs.python.org/issue1346created  neuralsensor 
   

BaseHTTPServer writing strings to bytes interface10/28/07
CLOSED http://bugs.python.org/issue1347created  janssen  
   py3k, patch 

httplib closes socket, then tries to read from it10/28/07
   http://bugs.python.org/issue1348created  janssen  
   py3k, patch 

more uses of ord() in plat-mac/ic.py 10/28/07
CLOSED http://bugs.python.org/issue1349created  janssen  
   py3k, patch 

IDLE - CallTips enhancement - show full doc-string in new window 10/28/07
   http://bugs.python.org/issue1350created  taleinat 
   patch   

Add getsize() to io instances10/28/07
   http://bugs.python.org/issue1351created  tiran
   

Preliminary stderr patch 10/28/07
CLOSED http://bugs.python.org/issue1352created  tiran
   

mp4 missing from mimetypes.py10/29/07
CLOSED http://bugs.python.org/issue1353created  kraft
   

windows installer problem10/29/07
   http://bugs.python.org/issue1354created  rajar
   

xml.dom refers to PyXML, which is no longer maintained   10/29/07
   http://bugs.python.org/issue1355created  whooey1830   
   

3.0a1 Solaris w/ SUN C/C++   10/29/07
CLOSED http://bugs.python.org/issue1356created  MrJean1  
   

3.0a1 make test Error on  Solaris w/ SUN C/C++   10/29/07
CLOSED 

Re: [Python-Dev] Request for inclusion in 2.5.2 (5-for-1)

2007-11-02 Thread Guido van Rossum
On 11/2/07, Mike Klaas <[EMAIL PROTECTED]> wrote:
> On 2-Nov-07, at 6:57 AM, Guido van Rossum wrote:
>
> > Since people are already jumping on those bugs but nobody has voiced
> > an opinion on your own patch, let me say that I think it's a good
> > patch, and I want it in 2.6, but I'm reluctant to add it to 2.5.2 as
> > it goes well beyond a bugfix (adding a new C API and all that).
>
> Thanks for looking at it!
>
> Is there a better way of exposing some c-helper code for a stdlib
> module written in python?  It seems that the canonical pattern is to
> write a separate extension module called _ and import the
> functionality from there, but that seemed like a significantly more
> invasive patch.

No, what you did was the right thing. It just doesn't feel like a bugfix to me.

> Might it help to tack on the helper function in posix only, deleting
> it from the os namespace?

No. Why are yo so insistent on having this in 2.5.2? You can't force
folks who use your code to upgrade (e.g. OSX Leopard was just shipped
with 2.5.1).

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com