[Python-Dev] Evil isinstance()
Samuele Pedroni
pedroni@inf.ethz.ch
Sat, 30 Mar 2002 18:20:37 +0100
From: Aahz <aahz@pythoncraft.com>
>
> The problem is that in some cases the __init__ for a class needs to
> dispatch based on the type of the operand. For example, int() takes
> both numbers and strings. What should we recommend as "standard
> practice" for this issue if isinstance() is disrecommended?
PEP 246 (?) <wink>
PS: I had a very heated discussion with Alex Martelli on anygui-devel
whether the PEP is ready for prime time, and whether
wrapping is so generally harmless, but I think
at some point the PEP should nevertheless be seriously discussed.
Likely the Zope3 people have some real data/experience
on adaptation to share.
PPS: it should be noted that the PEP does *not*
require first class interfaces to be adopted.
Those are an orthogonal issue.