| Store | Cart

PEP 318 (wrappers), multimethods, strict typechecking (was Re: OT(Slightly): Thanks to Python.

From: Ville Vainio <vil...@spammers.com>
13 Mar 2004 11:17:13 +0200
    Ville> Or in Python 2.4 (strict_type is hypothetical for now):

    Ville> def foo(a,b) [typecheck(type1, type2):
    Ville> pass

    Ville> def foo(a,b) [typecheck(type3, type4):
    Ville> pass

    Ville> which is even nicer :-).

Damn, my brain never works properly on sat/sun morning. Obviously I
meant that there could be wrappers for:

asserttype: check all args w/ isinstance

multimethod: dynamically choose the func/method to execute. Slow, but
sometimes people need it.

And if someone wonders what I'm going on about, check out:


This might also be a good time to dream up all kinds of cool wrappers
we can think about :)

Ville Vainio   http://tinyurl.com/2prnb

Recent Messages in this Thread
Aahz Mar 10, 2004 10:48 pm
David M. Wilson Mar 10, 2004 08:34 pm
Jacek Generowicz Mar 08, 2004 09:24 am
JanC Mar 09, 2004 09:25 pm
Michael Hudson Mar 10, 2004 11:47 am
Jacek Generowicz Mar 10, 2004 03:03 pm
JanC Mar 13, 2004 05:24 am
Josiah Carlson Mar 13, 2004 07:17 am
Ville Vainio Mar 13, 2004 09:08 am
Ville Vainio Mar 13, 2004 09:17 am
Messages in this thread