[Python-ideas] ML Style Pattern Matching for Python

Georg Brandl g.brandl at gmx.net
Sat Dec 18 18:34:57 CET 2010


Am 18.12.2010 12:23, schrieb Eike Welk:

> Instance Creation
> -----------------
> 
> foo = {| a=1, b=2 |}:Foo
> 
> This should be equivalent to:
> 
> foo = Foo(a=1, b=2)
> 
> In the usual case, it should not be necessary to specify the class name:
> 
> foo = {| a=1, b=2 |}
> 
> The run-time should search for a class with a matching "__init__" method.

I'm beginning to suspect this is an elaborate trolling attempt...




More information about the Python-ideas mailing list