[Python-Dev] Extended Function syntax

Martin v. Löwis martin@v.loewis.de
27 Jan 2003 01:18:15 +0100


Greg Ewing <greg@cosc.canterbury.ac.nz> writes:

> Do we want to be able to define and/or override
> get/set/del methods individually?

As opposed to?

The rationale for introducing the extended function syntax is that
extended functions should be introduced by means of a definition, not
of an assignment. For the same reason, I think properties should not
be introduced by means of an assignment. I can't picture how *not* to
define them individually, unless you are thinking of something like

  property foo:
    def get(self):
      ...
    def set(self, value):
      ...

> Whatever the mechanism, here's my current thoughts
> on a property syntax:
> 
>   def foo.get(self):
>     ...
> 
>   def foo.set(self, x):
>     ...
> 
>   def foo.del(self):
>     ...

So would you also be in favour of defining static methods through

   def static foo():
     ...

?

Regards,
Martin