[Python-3000] typeclasses, duck-typing
Antoine Pitrou
solipsis at pitrou.net
Tue May 9 19:10:14 CEST 2006
Hi,
Le mardi 09 mai 2006 à 12:46 -0400, Phillip J. Eby a écrit :
> Unless this can be done by a third party, it's not at all the same
> thing. Currently in Python for a third party to add a mixin, they would
> have to hack the class's __bases__, which I am not suggesting here at all.
>
> In fact, it's pretty much the opposite of what I'm suggesting -- you
> shouldn't *have* to make such declarations, let alone monkeypatch a class's
> __bases__.
Interestingly, there was a GNU addition to C++ named "signatures" which
achieved roughly the same thing: some kind of compile-time duck-typing.
http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_5.html#SEC112
Apparently it has been removed in gcc 3 or 4.
Regards
Antoine.
More information about the Python-3000
mailing list