isinstance() necessary and helpful, sometimes

Aahz Maruch aahz at panix.com
Fri Feb 1 12:46:07 EST 2002


In article <a2r97q$dpi$1 at serv1.iunet.it>, Alex Martelli <aleax at aleax.it> wrote:
>
>Wouldn't we want in this case to treat X**1.0 the same as X**1 the
>same as X**1L...?  A test such as exponent==int(exponent) would
>then seem to be more general and useful than isinstance(exponent,int).

I'd tend to code exponent==long(exponent) if I were targetting versions
of Python < 2.2.
-- 
                      --- Aahz  <*>  (Copyright 2002 by aahz at pobox.com)

Hugs and backrubs -- I break Rule 6                 http://www.rahul.net/aahz/
Androgynous poly kinky vanilla queer het Pythonista   

"The more you drive, the less intelligent you are."  --_Repo Man_



More information about the Python-list mailing list