alternating the builtin functions

Alex Martelli aleax at aleax.it
Mon Oct 20 12:28:57 EDT 2003


Carlo v. Dango wrote:

>> Actually, I think all Jp is really saying is don't use the name
>> "isinstance"
>> for your own... then none of this is an issue.  When you want your
>> version, you just call it.  The original stays unperturbed.
> 
> for any normal application I would agree with you, but Im toying with the
> language on a lower level... thanks for your tip.. it works, although, I
> had prefered a solution such as being able to call
> __builtins__.isinstance() instead.. ;-)

import __builtin__

(note, NO s in that identifier) and use __builtin__.isinstance at will.
(See p. 118 of "Python in a Nutshell" for a brief explanation).


Alex





More information about the Python-list mailing list