Re: [Python-Dev] Declaring setters with getters

2007-11-01 Thread Duncan Booth
"Steven Bethard" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > On 10/31/07, Fred Drake <[EMAIL PROTECTED]> wrote: >> If I had to choose built-in names, though, I'd prefer "property", >> "propset", "propdel". Another possibility that seems reasonable >> (perhaps a bit better) would be: >>

Re: [Python-Dev] Declaring setters with getters

2007-11-01 Thread Guido van Rossum
On 10/31/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > As long as we're all tossing out ideas here, my 2¢. I vastly prefer > this: > > On 02:43 am, [EMAIL PROTECTED] wrote: > >On 10/31/07, Fred Drake <[EMAIL PROTECTED]> wrote: > > >>@property.set > >>def attribute(self, value)

Re: [Python-Dev] Declaring setters with getters

2007-11-01 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Nov 1, 2007, at 10:01 AM, Guido van Rossum wrote: > On 10/31/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> As long as we're all tossing out ideas here, my 2¢. I vastly prefer >> this: >> >> On 02:43 am, [EMAIL PROTECTED] wrote: >>> On 10/31/

Re: [Python-Dev] Declaring setters with getters

2007-11-01 Thread glyph
On 02:01 pm, [EMAIL PROTECTED] wrote: On 10/31/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: As long as we're all tossing out ideas here, my 2�. I vastly prefer this: >>@property.set to this: > @property.set(attribute) I don't approve of it. It has always been and will always

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

2007-11-01 Thread Mike Klaas
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 mi

Re: [Python-Dev] Declaring setters with getters

2007-11-01 Thread Guido van Rossum
On 11/1/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > This is a minor nit, as with all decorators that take an argument, it > seems like it sets up a hard-to-debug error condition if you were to > accidentally forget it: > > @property > def foo(): ... > @property.set > def foo(

[Python-Dev] Explicit frame ref? (was Re: Declaring setters with getters)

2007-11-01 Thread Phillip J. Eby
At 07:01 AM 11/1/2007 -0700, Guido van Rossum wrote: >However I don't approve of it. It has always been and will always >continue to be my position that these are semantically unkosher, >because it means that you can't wrap them in convenience functions or >invoke them in different contexts, and th

[Python-Dev] Summary of Tracker Issues

2007-11-01 Thread Tracker
ACTIVITY SUMMARY (10/25/07 - 11/01/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. 1314 open (+21) / 11538 closed (+22) / 12852 total (+43) Open issues with patches: 415 Average durati

[Python-Dev] None in arguments to "".find and family of functions

2007-11-01 Thread Facundo Batista
Hello people! I'm following the issue 1259 (http://bugs.python.org/issue1259) It basically says that this should be ok: "'asd'.find('s', None, None)", as the documentation says that "start" and "end" arguments behaves like in slices (right now it gives a TypeError). I created a patch, that solve

Re: [Python-Dev] Declaring setters with getters

2007-11-01 Thread Tony Lownds
On Nov 1, 2007, at 10:26 AM, [EMAIL PROTECTED] wrote: > This is a minor nit, as with all decorators that take an argument, > it seems like it sets up a hard-to-debug error condition if you were > to accidentally forget it: > > @property > def foo(): ... > @property.set > def foo(): ...

Re: [Python-Dev] Python tickets summary

2007-11-01 Thread Facundo Batista
2007/10/25, Ron Adam <[EMAIL PROTECTED]>: > Clicking on one of the filter links changes the title back. (No Keyword, > Patch, P3K) Fixed, this was a bug, :( > I think the keyword and keywords interface can be improved. Do you have > any plans in that direction? Surely! But, no, I have no pl

Re: [Python-Dev] Declaring setters with getters

2007-11-01 Thread Guido van Rossum
-1. Looks like more magic, not less, to me. On 11/1/07, Tony Lownds <[EMAIL PROTECTED]> wrote: > > On Nov 1, 2007, at 10:26 AM, [EMAIL PROTECTED] wrote: > > This is a minor nit, as with all decorators that take an argument, > > it seems like it sets up a hard-to-debug error condition if you were >

Re: [Python-Dev] Declaring setters with getters

2007-11-01 Thread Greg Ewing
Guido van Rossum wrote: > if you want more control, you can just get the property object out of > the class you want You're quite right. I was thinking that getting the property would trigger the access machinery, but of course you're getting it from the class rather than the instance, so that doe

Re: [Python-Dev] Declaring setters with getters

2007-11-01 Thread Greg Ewing
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.

Re: [Python-Dev] Declaring setters with getters

2007-11-01 Thread Greg Ewing
Raymond Hettinger wrote: > Let's stick with "propset" which has precedent as an svn action and > serves as a short, simple mnemonic to the functionality. But if we're going to have "propset", it raises the question of why there isn't a "propget". -- Greg

Re: [Python-Dev] Declaring setters with getters

2007-11-01 Thread Phillip J. Eby
At 11:11 AM 11/2/2007 +1300, Greg Ewing wrote: >Raymond Hettinger wrote: > > Let's stick with "propset" which has precedent as an svn action and > > serves as a short, simple mnemonic to the functionality. > >But if we're going to have "propset", it raises the question >of why there isn't a "propg

Re: [Python-Dev] Declaring setters with getters

2007-11-01 Thread Guido van Rossum
On 11/1/07, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > At 11:11 AM 11/2/2007 +1300, Greg Ewing wrote: > >Raymond Hettinger wrote: > > > Let's stick with "propset" which has precedent as an svn action and > > > serves as a short, simple mnemonic to the functionality. > > > >But if we're going to h

Re: [Python-Dev] Declaring setters with getters

2007-11-01 Thread Fred Drake
On Oct 31, 2007, at 10:23 PM, Barry Warsaw wrote: > BTW, +1 on this. I like Fred's suggestion of property.set(). Thanks! Of all the proposals that have been presented, I still like that the best. Guido's use case of wanting to give the r/w property a different name than the r/o property is

Re: [Python-Dev] Does Python need a file locking module (slightly higher level)?

2007-11-01 Thread skip
> The API and almost all test cases are defined in a _FileLock base > class. You could (in theory at least) subclass it to provide locking > through some other shared resource like a database and not have to > write and or many other test cases. Okay, this is up on my website:

Re: [Python-Dev] Declaring setters with getters

2007-11-01 Thread Fred Drake
On Nov 1, 2007, at 9:18 PM, Fred Drake wrote: Thanks! Of all the proposals that have been presented, I still like that the best. I've attached a quick hack of an implementation, just to play with it and see how it feels. Here's an example use: from property import property class Base(o