[Python-Dev] Extended Function syntax

Jack Jansen Jack.Jansen@oratrix.com
Wed, 29 Jan 2003 23:55:32 +0100


On woensdag, jan 29, 2003, at 22:42 Europe/Amsterdam, Guido van Rossum 
wrote:

>>> But the problem is that it makes proprty a keyword, which is a Big
>>> Change.
>>
>> The more kludgy workarounds I see proposed here for *not* having a new
>> keyword, the more I feel that it would be worth whatever pain it takes
>> to add one, to get a decent, clean, magic-free syntax for properties.
>
> Agreed.  It will take longer, but it's The Right Thing.  Which is why
> I'm shooting down all ugly half-solutions.

Can't we do something along the lines of "import as"? I.e. allow either 
one or two identifiers after a def, and if there's two then the first 
one changes what happens? Then we could say
def property foo:
	...

Hmm, the __name__'s of various builtin types are not exposed in any 
namespace, are they? Otherwise we could say that "def foo():" is really 
a shorthand for "def xxx.function foo():", and maybe even "class Bar:" 
for "def xxx.classobj Bar:"
--
- Jack Jansen        <Jack.Jansen@oratrix.com>        
http://www.cwi.nl/~jack -
- If I can't dance I don't want to be part of your revolution -- Emma 
Goldman -