[Python-Dev] Extended Function syntax (original) (raw)
Samuele Pedroni pedronis@bluewin.ch
Sun, 2 Feb 2003 20:21:05 +0100
- Previous message: [Python-Dev] Extended Function syntax
- Next message: [Python-Dev] Extended Function syntax
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: "Samuele Pedroni" <pedronis@bluewin.ch>
From: "Guido van Rossum" <guido@python.org> > I think so far I've been thinking mostly about fitting my proposal on > all edges (that's where my discussion of the thunk's scope comes > from). Maybe I should try to focus more on collecting real-world > examples that are asking for syntactic support, and then try to look > for the simplest way to support most of them.
yes, real-world examples would be good.
In particular real-world examples, not covered by 'for' and generators or 'with'*, that need rebinding the surrounding function locals and/or non-local return.
[Just for fun, on the hackery/contrived side of things, we would finally get a version of Paul Graham's accumulator generator http://www.paulgraham.com/accgen.html with mostly lisp-y length:
def accmaker(n): do acc = (lambda x:x): (i): n += i value n # ! not 'return', that would be a non-local return return acc
]
with :
would be possibly sugar for:
_x = _x.enter() try: finally: _x.exit()
OR:
_x = _x.enter() try: try: except getattr(_x,'excepts',()),_e: _x.except(_e) finally: _x.exit()
- Previous message: [Python-Dev] Extended Function syntax
- Next message: [Python-Dev] Extended Function syntax
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]