I don't have any real opinion on this, but this old experiment seems related to the discussion: http://svn.colorstudy.com/home/ianb/recipes/patmatch.py

--
Sent from a phone

On Dec 18, 2010 12:30 PM, "Eike Welk" <eike.welk@gmx.net> wrote:

On Saturday 18.12.2010 18:34:57 Georg Brandl wrote:
> Am 18.12.2010 12:23, schrieb Eike Welk:
> > In...

Yes, it's a bit of fun. This would never get into Python anyway, but I'd like
it nevertheless. (It is Ocaml's record syntax with some small tweaks.)

It would be possible to realize it though. With "inspect.getfullargspec" you
can see the a function's signature. There might be problems with efficiency,
because you'd have to search through globals and locals repeatedly. You you
could however store which class matched, somewhere in the code object.

Storing this kind of information would go against Python's nature as a dynamic
language, even though it would work as expected in 99% of the use cases. Oh
well ...


Eike

_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
ht...