[Python-ideas] @return?
Nick Coghlan
ncoghlan at gmail.com
Wed Apr 14 23:52:20 CEST 2010
Masklinn wrote:
> On 14 Apr 2010, at 18:41 , Conrad Irwin wrote
>> As I understand it, there is little desire to allow function definitions
>> to appear "just anywhere" in Python.
>
> I don't believe that's true, but it is possible that people who express
> this desire are directed towards other languages.
Limit the scope to "the core devs" and Conrad's statement is probably
true :)
The problem is that:
1. Whitespace is highly significant in delineating scope and separation
at a statement level
2. Whitespace is largely insignificant at the expression level
That means that anonymous functions that are not limited to a single
expression require either:
a. the introduction of significant whitespace into a particular kind of
expression (ugly, breaks the back of the deliberately created
statement/expression distinction noted above)
or
b. the introduction of a full statement syntax which isn't dependent on
significant whitespace (which grossly violates There's One Obvious Way
To Do It)
The course most likely to bear fruit is actually for people to identify
what tools they need in the functools module in order to make Python
expressions Turing complete (you should be able to use functional
programming tricks to attain that without needing to introduce embedded
assignments).
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
---------------------------------------------------------------
More information about the Python-ideas
mailing list