Re: [Python-Dev] properties and block statement

2005-10-18 Thread Antoine Pitrou
> What would this mythical block statement look like that would make > properties easier to write than the above late-binding or the subclass > Property recipe? I suppose something like: class C(object): x = prop: """ Yay for property x! """ def __get__(self):

Re: [Python-Dev] properties and block statement

2005-10-18 Thread Antoine Pitrou
Le mardi 18 octobre 2005 à 19:17 +0200, Antoine Pitrou a écrit : > > What would this mythical block statement look like that would make > > properties easier to write than the above late-binding or the subclass > > Property recipe? > > I suppose something like: > > class C(object): > x =

Re: [Python-Dev] properties and block statement

2005-10-18 Thread Josiah Carlson
Antoine Pitrou <[EMAIL PROTECTED]> wrote: > > > > What would this mythical block statement look like that would make > > properties easier to write than the above late-binding or the subclass > > Property recipe? > > I suppose something like: > > class C(object): > x = prop: >

Re: [Python-Dev] properties and block statement

2005-10-18 Thread Antoine Pitrou
Le mardi 18 octobre 2005 à 12:56 -0700, Josiah Carlson a écrit : > You are saving 3 lines over the decorator/function approach [...] Well, obviously, the point of a block statement or construct is that it can be applied to many other things than properties. Otherwise it is overkill as you imply.

Re: [Python-Dev] properties and block statement

2005-10-19 Thread Stefan Rank
on 18.10.2005 19:17 Antoine Pitrou said the following: >>What would this mythical block statement look like that would make >>properties easier to write than the above late-binding or the subclass >>Property recipe? > > I suppose something like: > > class C(object): > x = prop: >

Re: [Python-Dev] properties and block statement

2005-10-19 Thread Duncan Booth
Stefan Rank <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > I think there is no need for a special @syntax for this to work. > > I suppose it would be possible to allow a trailing block after any > function invocation, with the effect of creating a new namespace that > gets treated as co