Syntax-wise [Python-Dev] Property syntax

Samuele Pedroni pedronis@bluewin.ch
Fri, 31 Jan 2003 21:14:56 +0100


From: "Samuele Pedroni" <pedronis@bluewin.ch>
> - I think that there should be a *distinguashable* syntax for
introducing/using
> thunks with inline-suite scoping vs. 'class'-like scoping. I'm very very very
> uncomfortable with the idea of variable-geometry scoping, that means that I
> would have to go read some hairy code defining 'foo' in order to know:
>
> def f():
>   x=3
>   foo:
>     x=2
>
> whether the second x= is modifying the local x to f, or is just local to foo
> suite.

So syntax-wise I personally would go for:

do iterate(lst): (x):
  print x

introducing a new-keyword 'do' (or something similar) and that would imply
inline-suite-like scoping.

And

[KEYW-TO-ESTABLISH-OR-NOTHING] property foo:
 ...

[KEYW-TO-ESTABLISH-OR-NOTHING] interface.interface I(J,K):
 ...

implying 'class'-like scoping and not allowing the thunk maybe to take
arguments or have break/continue/return(/value) in it.

regards