On Mon, 08 Aug 2005 21:24:15 -0400, Nicolas Fleury <[EMAIL PROTECTED]> wrote:
>Bengt Richter wrote: >> On Mon, 08 Aug 2005 16:18:50 -0400, Nicolas Fleury <[EMAIL PROTECTED]> wrote: >>>I wrote the PEP to see if was the only one that would benefit from >>>generic types *before* having optional static typing in the language. >>> >>>It seems I'm the only one;) >>> >>>According to blog entry 86641, Guido himself is prototyping with >>>__getitem__. However, I cannot do the same, because the framework I use >>>is much more complete and keyword arguments are a must. >>> >> Here is a decorator object to set up function call dispatch according to >> type. >> It only uses positional arguments, but could be fleshed out, I think. >> Not tested beyond what you see ;-) > >That's nice. Guido also posted this multimethods solution: >http://www.artima.com/weblogs/viewpost.jsp?thread=101605 > When I first read that, I thought you meant he had posted the very same thing. Anyway, maybe mine is different enough to be a little interesting ;-) >The only thing I was saying it that I can use generic types in Python >right now (and I do), by using (), but I can't with what will probably >be the syntax in future, i.e. using []. > Ok ;-) <gesture action="magic handwave"/> Maybe sometime in the future it will be possible to modify the language grammar and define a few classes and regenerate a whole new python interpreter that interprets new syntax. Regards, Bengt Richter -- http://mail.python.org/mailman/listinfo/python-list