[SciPy-User] Integer dtype comparisons

Graham, Michael Michael.Graham@cdicorp....
Thu Sep 30 10:31:58 CDT 2010


On Wednesday, September 29, 2010 at 3:00PM, Travis Oliphant wrote:
> try:
>	obj_as_integer =	obj.__index__()
>         # code to use obj_as_integer
> except (TypeError, AttributeError):
>	# some other code....
>
> -Travis

Surely you mean

try:
    obj_as_integer =	obj.__index__()
except (TypeError, AttributeError):
    # some other code....
code to use obj_as_integer


-or-


try:
    obj_as_integer =	obj.__index__()
except (TypeError, AttributeError):
    # some other code....
else:
    code to use obj_as_integer



Mike



Mike Graham
Software Engineer
CDI Marine - Band Lavis Division
6960 Aviation Blvd, Suite A
Glen Burnie, MD 21061



______________________________________________________________________
CONFIDENTIALITY NOTICE:  This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information which is confidential to, and/or privileged in favor of, CDI Corporation or its affiliated companies (CDI) or CDI's customers.  Any review, use, reproduction, disclosure or distribution by the recipient is prohibited without prior written approval from an authorized CDI representative.  This notice must appear in any such authorized reproduction, disclosure or distribution.  If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message and any attachments.  Thank you.


More information about the SciPy-User mailing list