IntegerConversion¶
Legacy Wiki Page
This page was migrated from the old MoinMoin-based wiki. Information may be outdated or no longer applicable. For current documentation, see python.org.
When using asInt, consider whether you want to ensure the original object is an instanceof PyInteger/PyLong prior to calling asInt on it. It’s common to do this check before calling asInt, but is not required – otherwise asInt will attempt to implicitly convert non int/longs via user defined __int__ methods.