[Python-Dev] Py3k: Except clause syntax (original) (raw)
Gareth McCaughan gmccaughan at synaptics-uk.com
Mon Mar 20 07:00:02 CET 2006
- Previous message: [Python-Dev] Py3k: Except clause syntax
- Next message: [Python-Dev] Py3k: Except clause syntax
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Friday 2006-03-17 05:04, Alex Martelli wrote:
Hmmm, if we allowed '( as )' for generic expr's we'd make a lot of people pining for 'assignment as an expression' very happy, wouldn't we...?
I hope not. It looks a lot more like a binding construct than an assigning one. But what about "pattern-matching"? Currently, you can say
def f((x0,y0), (x1,y1)):
...
but wouldn't if be nice if you could say
def f((x0,y0) as p0, (x1,y1) as p1):
...
and have both the "packed" and "unpacked" forms available? (Prior art: some functional languages that let you define a function with multiple "pattern-matching" clauses have a similar feature.)
-- g
- Previous message: [Python-Dev] Py3k: Except clause syntax
- Next message: [Python-Dev] Py3k: Except clause syntax
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]