[Python-Dev] Extended Function syntax (original) (raw)
Lalo Martins lalo@laranja.org
Wed, 29 Jan 2003 11:59:23 -0200
- Previous message: [Python-Dev] Extended Function syntax
- Next message: [Python-Dev] Extended Function syntax
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Wed, Jan 29, 2003 at 01:32:11AM -0500, Guido van Rossum wrote:
I have no idea what you mean by this. This doesn't look like Python at all.
I guess he meant that a method that has its first argument named "class" is automagically a class method. I strongly object.
(Besides, he seems to want a class init, which isn't really needed - this is what the class declaration body is for)
However this could work:
class Foo(object): myprop = property: """A computed property on Foo objects.""" def get(self): return ... def set(self, value): ... def delete(self): ...
This would call property() with the results of parsing the indented block. Not sure yet this is a good idea, but it could have many other (possibly good, possibly harmful) uses.
[]s, |alo +----
Those who trade freedom for security
lose both and deserve neither.
-- http://www.laranja.org/ mailto:lalo@laranja.org pgp key: http://www.laranja.org/pessoal/pgp
Eu jogo RPG! (I play RPG) http://www.eujogorpg.com.br/ GNU: never give up freedom http://www.gnu.org/
- Previous message: [Python-Dev] Extended Function syntax
- Next message: [Python-Dev] Extended Function syntax
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]