Michael Spencer wrote:
while we're at it, perhaps 'for' would be more appropriate:

(expression for args(a, *args, **kw))

Hmm, what about an 'abbreviated generator expression' syntax:

(<expression> for <args-tuple>)

For instance:

(f(a) + g(b) - h(c) for (a, b, c))

(the 'in' clause of the standard generator expression is missing).

That does leave the question of the correct spelling of 'no arguments', which generator expressions don't have to deal with. Perhaps:

(f.close() for ())

It does make for an interesting interpretation of the generator expression 
syntax:

(<expression> for <args-tuple> in <sequence> if <condition>)

def expression_func(<args-tuple>):
  return <expression>

def generator():
  for <args-tuple> in <sequence>
    if <condition>:
      yield expression_func(<args-tuple>)

Cheers,
Nick.

--
Nick Coghlan   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---------------------------------------------------------------
            http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to