PEP: Specialization Syntax

Nicolas Fleury nid_oizo at yahoo.com_removethe_
Mon Aug 8 16:18:50 EDT 2005


Bengt Richter wrote:
> On Sun, 07 Aug 2005 21:41:33 -0400, Nicolas Fleury <nid_oizo at yahoo.com_removethe_> wrote:
>>I mean should angle brackets <> like in C++, or another operator, be 
>>used instead?
> 
> I am getting the feeling that your PEP is about a means to do something C++-like
> in python, not necessarily to enhance python ;-) IOW, it seems like you
> want the [<new syntax>] to do something like C++ <type_spec> in templates?

Yes, exactly.  Actually Guido also mentionned pointy brackets:
http://www.artima.com/weblogs/viewpost.jsp?thread=86641

> (BTW, I have nothing against giving python new capabilities (quite the reverse),
> but not by grafting limbs from other animals ;-)

If I look at a very recent blog entry of Guido, it seems the idea is 
still in the air:
http://www.artima.com/weblogs/viewpost.jsp?thread=92662

> Maybe you want hidden name-mangling of function defs according to arg types
> and corresponding dispatching of calls? I am afraid I am still not clear
> on the fundamental motivation for all this ;-)

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.

Regards,
Nicolas



More information about the Python-list mailing list