"""The builtin int implementationIn order to have the same behavior running on CPython, and after RPythontranslation this module uses rarithmetic.ovfcheck to explicitly checkfor overflows, something CPython does not do anymore."""importoperatorimportsysfromrpython.rlibimportjitfromrpython.rlib.objectmodelimportinstantiatefromrpython.rlib.rarithmeticimport(LONG_BIT,is_valid_int,ovfcheck,r_longlong,r_uint,string_to_int)fromrpython.rlib.rbigintimportrbigintfromrpython.rlib.rfloatimportDBL_MANT_DIGfromrpython.rlib.rstringimport(ParseStringError,ParseStringOverflowError)fromrpython.tool.sourcetoolsimportfunc_renamer,func_with_new_namefrompypy.interpreterimporttypedeffrompypy.interpreter.baseobjspaceimportW_Rootfrompypy.interpreter.errorimportOperationError,oefmtfrompypy.interpreter.gatewayimportWrappedDefault,interp2app,unwrap_specfrompypy.interpreter.typedefimportTypeDeffrompypy.objspace.stdimportnewformatfrompypy.objspace.std.utilimport(BINARY_OPS,CMP_OPS,COMMUTATIVE_OPS,IDTAG_INT,wrap_parsestringerror)SENTINEL=object()classW_AbstractIntObject(W_Root):__slots__=()defis_w(self,space,w_other):frompypy.objspace.std.boolobjectimportW_BoolObjectif(notisinstance(w_other,W_AbstractIntObject)orisinstance(w_other,W_BoolObject)):returnFalseifself.user_overridden_classorw_other.user_overridden_class:returnselfisw_otherreturn(space.int_w(self,allow_conversion=False)==space.int_w(w_other,allow_conversion=False))defimmutable_unique_id(self,space):ifself.user_overridden_class:returnNoneb=space.bigint_w(self)b=b.lshift(3).int_or_(IDTAG_INT)returnspace.newlong_from_rbigint(b)defint(self,space):"""x.__int__() <==> int(x)"""raiseNotImplementedErrordefdescr_format(self,space,w_format_spec):raiseNotImplementedErrordefdescr_pow(self,space,w_exponent,w_modulus=None):"""x.__pow__(y[, z]) <==> pow(x, y[, z])"""raiseNotImplementedErrordescr_rpow=func_with_new_name(descr_pow,'descr_rpow')descr_rpow.__doc__="y.__rpow__(x[, z]) <==> pow(x, y[, z])"def_abstract_unaryop(opname,doc=SENTINEL):ifdocisSENTINEL:doc='x.__%s__() <==> %s(x)'%(opname,opname)@func_renamer('descr_'+opname)defdescr_unaryop(self,space):raiseNotImplementedErrordescr_unaryop.__doc__=docreturndescr_unaryopdescr_repr=_abstract_unaryop('repr')descr_str=_abstract_unaryop('str')descr_coerce=_abstract_unaryop('coerce')descr_conjugate=_abstract_unaryop('conjugate',"Returns self, the complex conjugate of any int.")descr_bit_length=_abstract_unaryop('bit_length',"""\ int.bit_length() -> int Number of bits necessary to represent self in binary. >>> bin(37) '0b100101' >>> (37).bit_length() 6""")descr_hash=_abstract_unaryop('hash')descr_oct=_abstract_unaryop('oct')descr_hex=_abstract_unaryop('hex')descr_getnewargs=_abstract_unaryop('getnewargs',None)descr_long=_abstract_unaryop('long')descr_index=_abstract_unaryop('index',"x[y:z] <==> x[y.__index__():z.__index__()]")descr_trunc=_abstract_unaryop('trunc',"Truncating an Integral returns itself.")descr_float=_abstract_unaryop('float')descr_pos=_abstract_unaryop('pos',"x.__pos__() <==> +x")descr_neg=_abstract_unaryop('neg',"x.__neg__() <==> -x")descr_abs=_abstract_unaryop('abs')descr_nonzero=_abstract_unaryop('nonzero',"x.__nonzero__() <==> x != 0")descr_invert=_abstract_unaryop('invert',"x.__invert__() <==> ~x")def_abstract_cmpop(opname):@func_renamer('descr_'+opname)defdescr_cmp(self,space,w_other):raiseNotImplementedErrordescr_cmp.__doc__='x.__%s__(y) <==> x%sy'%(opname,CMP_OPS[opname])returndescr_cmpdescr_lt=_abstract_cmpop('lt')descr_le=_abstract_cmpop('le')descr_eq=_abstract_cmpop('eq')descr_ne=_abstract_cmpop('ne')descr_gt=_abstract_cmpop('gt')descr_ge=_abstract_cmpop('ge')def_abstract_binop(opname):oper=BINARY_OPS.get(opname)ifoper=='%':oper='%%'oper='%s(%%s, %%s)'%opnameifnotoperelse'%%s%s%%s'%oper@func_renamer('descr_'+opname)defdescr_binop(self,space,w_other):raiseNotImplementedErrordescr_binop.__doc__="x.__%s__(y) <==> %s"%(opname,oper%('x','y'))descr_rbinop=func_with_new_name(descr_binop,'descr_r'+opname)descr_rbinop.__doc__="x.__r%s__(y) <==> %s"%(opname,oper%('y','x'))returndescr_binop,descr_rbinopdescr_add,descr_radd=_abstract_binop('add')descr_sub,descr_rsub=_abstract_binop('sub')descr_mul,descr_rmul=_abstract_binop('mul')descr_and,descr_rand=_abstract_binop('and')descr_or,descr_ror=_abstract_binop('or')descr_xor,descr_rxor=_abstract_binop('xor')descr_lshift,descr_rlshift=_abstract_binop('lshift')descr_rshift,descr_rrshift=_abstract_binop('rshift')descr_floordiv,descr_rfloordiv=_abstract_binop('floordiv')descr_div,descr_rdiv=_abstract_binop('div')descr_truediv,descr_rtruediv=_abstract_binop('truediv')descr_mod,descr_rmod=_abstract_binop('mod')descr_divmod,descr_rdivmod=_abstract_binop('divmod')def_floordiv(space,x,y):try:z=ovfcheck(x//y)exceptZeroDivisionError:raiseoefmt(space.w_ZeroDivisionError,"integer division by zero")returnwrapint(space,z)_div=func_with_new_name(_floordiv,'_div')def_truediv(space,x,y):ifnoty:raiseoefmt(space.w_ZeroDivisionError,"division by zero")if(DBL_MANT_DIG<LONG_BITand(r_uint(abs(x))>>DBL_MANT_DIGorr_uint(abs(y))>>DBL_MANT_DIG)):# large x or y, use long arithmeticraiseOverflowError# both ints can be exactly represented as doubles, do a# floating-point divisiona=float(x)b=float(y)returnspace.wrap(a/b)def_mod(space,x,y):try:z=ovfcheck(x%y)exceptZeroDivisionError:raiseoefmt(space.w_ZeroDivisionError,"integer modulo by zero")returnwrapint(space,z)def_divmod(space,x,y):try:z=ovfcheck(x//y)exceptZeroDivisionError:raiseoefmt(space.w_ZeroDivisionError,"integer divmod by zero")# no overflow possiblem=x%yw=space.wrapreturnspace.newtuple([w(z),w(m)])def_divmod_ovf2small(space,x,y):frompypy.objspace.std.smalllongobjectimportW_SmallLongObjecta=r_longlong(x)b=r_longlong(y)returnspace.newtuple([W_SmallLongObject(a//b),W_SmallLongObject(a%b)])def_lshift(space,a,b):ifr_uint(b)<LONG_BIT:# 0 <= b < LONG_BITc=ovfcheck(a<<b)returnwrapint(space,c)ifb<0:raiseoefmt(space.w_ValueError,"negative shift count")# b >= LONG_BITifa==0:returnwrapint(space,a)raiseOverflowErrordef_lshift_ovf2small(space,a,b):frompypy.objspace.std.smalllongobjectimportW_SmallLongObjectw_a=W_SmallLongObject.fromint(a)w_b=W_SmallLongObject.fromint(b)returnw_a.descr_lshift(space,w_b)def_rshift(space,a,b):ifr_uint(b)>=LONG_BIT:# not (0 <= b < LONG_BIT)ifb<0:raiseoefmt(space.w_ValueError,"negative shift count")# b >= LONG_BITifa==0:returnwrapint(space,a)a=-1ifa<0else0else:a=a>>breturnwrapint(space,a)@jit.look_inside_iff(lambdaspace,iv,iw,iz:jit.isconstant(iw)andjit.isconstant(iz))def_pow(space,iv,iw,iz):"""Helper for pow"""ifiw<0:ifiz!=0:raiseoefmt(space.w_TypeError,"pow() 2nd argument cannot be negative when 3rd ""argument specified")# bounce it, since it always returns floatraiseValueErrortemp=ivix=1whileiw>0:ifiw&1:ix=ovfcheck(ix*temp)iw>>=1# Shift exponent down by 1 bitifiw==0:breaktemp=ovfcheck(temp*temp)# Square the value of tempifiz:# If we did a multiplication, perform a moduloix%=iztemp%=izifiz:ix%=izreturnixdef_pow_ovf2long(space,iv,iw,w_modulus):ifspace.is_none(w_modulus)and_recover_with_smalllong(space):frompypy.objspace.std.smalllongobjectimport_powas_pow_smalltry:# XXX: shouldn't have to pass r_longlong(0) here (see# 4fa4c6b93a84)return_pow_small(space,r_longlong(iv),iw,r_longlong(0))except(OverflowError,ValueError):passfrompypy.objspace.std.longobjectimportW_LongObjectw_iv=W_LongObject.fromint(space,iv)w_iw=W_LongObject.fromint(space,iw)returnw_iv.descr_pow(space,w_iw,w_modulus)def_make_ovf2long(opname,ovf2small=None):op=getattr(operator,opname,None)assertoporovf2smalldefovf2long(space,x,y):"""Handle overflowing to smalllong or long"""if_recover_with_smalllong(space):ifovf2small:returnovf2small(space,x,y)# Assume a generic operation without an explicit ovf2small# handlerfrompypy.objspace.std.smalllongobjectimportW_SmallLongObjecta=r_longlong(x)b=r_longlong(y)returnW_SmallLongObject(op(a,b))frompypy.objspace.std.longobjectimportW_LongObjectw_x=W_LongObject.fromint(space,x)w_y=W_LongObject.fromint(space,y)returngetattr(w_x,'descr_'+opname)(space,w_y)returnovf2longclassW_IntObject(W_AbstractIntObject):__slots__='intval'_immutable_fields_=['intval']def__init__(self,intval):assertis_valid_int(intval)self.intval=intvaldef__repr__(self):"""representation for debugging purposes"""return"%s(%d)"%(self.__class__.__name__,self.intval)defint_w(self,space,allow_conversion=True):returnint(self.intval)def_int_w(self,space):returnint(self.intval)unwrap=_int_wdefuint_w(self,space):intval=self.intvalifintval<0:raiseoefmt(space.w_ValueError,"cannot convert negative integer to unsigned")returnr_uint(intval)defbigint_w(self,space,allow_conversion=True):returnrbigint.fromint(self.intval)def_bigint_w(self,space):returnrbigint.fromint(self.intval)deffloat_w(self,space,allow_conversion=True):returnfloat(self.intval)# note that we do NOT implement _float_w, because __float__ cannot return# an intdefint(self,space):iftype(self)isW_IntObject:returnselfifnotspace.is_overloaded(self,space.w_int,'__int__'):returnspace.newint(self.intval)returnW_Root.int(self,space)@staticmethod@unwrap_spec(w_x=WrappedDefault(0))defdescr_new(space,w_inttype,w_x,w_base=None):"""T.__new__(S, ...) -> a new object with type S, a subtype of T"""return_new_int(space,w_inttype,w_x,w_base)defdescr_hash(self,space):# unlike CPython, we don't special-case the value -1 in most of# our hash functions, so there is not much sense special-casing# it here either. Make sure this is consistent with the hash of# floats and longs.returnself.int(space)def_int(self,space):returnself.int(space)descr_pos=func_with_new_name(_int,'descr_pos')descr_index=func_with_new_name(_int,'descr_index')descr_trunc=func_with_new_name(_int,'descr_trunc')descr_conjugate=func_with_new_name(_int,'descr_conjugate')descr_get_numerator=func_with_new_name(_int,'descr_get_numerator')descr_get_real=func_with_new_name(_int,'descr_get_real')defdescr_get_denominator(self,space):returnwrapint(space,1)defdescr_get_imag(self,space):returnwrapint(space,0)defdescr_coerce(self,space,w_other):ifnotisinstance(w_other,W_AbstractIntObject):returnspace.w_NotImplementedreturnspace.newtuple([self,w_other])defdescr_long(self,space):# XXX: should try smalllongfrompypy.objspace.std.longobjectimportW_LongObjectreturnW_LongObject.fromint(space,self.intval)defdescr_nonzero(self,space):returnspace.newbool(self.intval!=0)defdescr_invert(self,space):returnwrapint(space,~self.intval)defdescr_neg(self,space):a=self.intvaltry:b=ovfcheck(-a)exceptOverflowError:if_recover_with_smalllong(space):frompypy.objspace.std.smalllongobjectimportW_SmallLongObjectx=r_longlong(a)returnW_SmallLongObject(-x)returnself.descr_long(space).descr_neg(space)returnwrapint(space,b)defdescr_abs(self,space):pos=self.intval>=0returnself.int(space)ifposelseself.descr_neg(space)defdescr_float(self,space):a=self.intvalx=float(a)returnspace.newfloat(x)defdescr_oct(self,space):returnspace.wrap(oct(self.intval))defdescr_hex(self,space):returnspace.wrap(hex(self.intval))defdescr_getnewargs(self,space):returnspace.newtuple([wrapint(space,self.intval)])defdescr_bit_length(self,space):val=self.intvalbits=0ifval<0:# warning, "-val" overflows hereval=-((val+1)>>1)bits=1whileval:bits+=1val>>=1returnspace.wrap(bits)defdescr_repr(self,space):res=str(self.intval)returnspace.wrap(res)descr_str=func_with_new_name(descr_repr,'descr_str')defdescr_format(self,space,w_format_spec):returnnewformat.run_formatter(space,w_format_spec,"format_int_or_long",self,newformat.INT_KIND)@unwrap_spec(w_modulus=WrappedDefault(None))defdescr_pow(self,space,w_exponent,w_modulus=None):ifnotisinstance(w_exponent,W_IntObject):returnspace.w_NotImplementedx=self.intvaly=w_exponent.intvalifspace.is_none(w_modulus):z=0elifisinstance(w_modulus,W_IntObject):z=w_modulus.intvalifz==0:raiseoefmt(space.w_ValueError,"pow() 3rd argument cannot be 0")else:# can't return NotImplemented (space.pow doesn't do full# ternary, i.e. w_modulus.__zpow__(self, w_exponent)), so# handle it ourselvesreturn_pow_ovf2long(space,x,y,w_modulus)try:result=_pow(space,x,y,z)except(OverflowError,ValueError):return_pow_ovf2long(space,x,y,w_modulus)returnspace.wrap(result)@unwrap_spec(w_modulus=WrappedDefault(None))defdescr_rpow(self,space,w_base,w_modulus=None):ifnotisinstance(w_base,W_IntObject):returnspace.w_NotImplementedreturnw_base.descr_pow(space,self,w_modulus)def_make_descr_cmp(opname):op=getattr(operator,opname)@func_renamer('descr_'+opname)defdescr_cmp(self,space,w_other):ifnotisinstance(w_other,W_IntObject):returnspace.w_NotImplementedi=self.intvalj=w_other.intvalreturnspace.newbool(op(i,j))returndescr_cmpdescr_lt=_make_descr_cmp('lt')descr_le=_make_descr_cmp('le')descr_eq=_make_descr_cmp('eq')descr_ne=_make_descr_cmp('ne')descr_gt=_make_descr_cmp('gt')descr_ge=_make_descr_cmp('ge')def_make_generic_descr_binop(opname,ovf=True):op=getattr(operator,opname+'_'ifopnamein('and','or')elseopname)descr_rname='descr_r'+opnameifovf:ovf2long=_make_ovf2long(opname)@func_renamer('descr_'+opname)defdescr_binop(self,space,w_other):ifnotisinstance(w_other,W_IntObject):returnspace.w_NotImplementedx=self.intvaly=w_other.intvalifovf:try:z=ovfcheck(op(x,y))exceptOverflowError:returnovf2long(space,x,y)else:z=op(x,y)returnwrapint(space,z)ifopnameinCOMMUTATIVE_OPS:@func_renamer(descr_rname)defdescr_rbinop(self,space,w_other):returndescr_binop(self,space,w_other)returndescr_binop,descr_rbinop@func_renamer(descr_rname)defdescr_rbinop(self,space,w_other):ifnotisinstance(w_other,W_IntObject):returnspace.w_NotImplementedx=self.intvaly=w_other.intvalifovf:try:z=ovfcheck(op(y,x))exceptOverflowError:returnovf2long(space,y,x)else:z=op(y,x)returnwrapint(space,z)returndescr_binop,descr_rbinopdescr_add,descr_radd=_make_generic_descr_binop('add')descr_sub,descr_rsub=_make_generic_descr_binop('sub')descr_mul,descr_rmul=_make_generic_descr_binop('mul')descr_and,descr_rand=_make_generic_descr_binop('and',ovf=False)descr_or,descr_ror=_make_generic_descr_binop('or',ovf=False)descr_xor,descr_rxor=_make_generic_descr_binop('xor',ovf=False)def_make_descr_binop(func,ovf=True,ovf2small=None):opname=func.__name__[1:]ifovf:ovf2long=_make_ovf2long(opname,ovf2small)@func_renamer('descr_'+opname)defdescr_binop(self,space,w_other):ifnotisinstance(w_other,W_IntObject):returnspace.w_NotImplementedx=self.intvaly=w_other.intvalifovf:try:returnfunc(space,x,y)exceptOverflowError:returnovf2long(space,x,y)else:returnfunc(space,x,y)@func_renamer('descr_r'+opname)defdescr_rbinop(self,space,w_other):ifnotisinstance(w_other,W_IntObject):returnspace.w_NotImplementedx=self.intvaly=w_other.intvalifovf:try:returnfunc(space,y,x)exceptOverflowError:returnovf2long(space,y,x)else:returnfunc(space,y,x)returndescr_binop,descr_rbinopdescr_lshift,descr_rlshift=_make_descr_binop(_lshift,ovf2small=_lshift_ovf2small)descr_rshift,descr_rrshift=_make_descr_binop(_rshift,ovf=False)descr_floordiv,descr_rfloordiv=_make_descr_binop(_floordiv)descr_div,descr_rdiv=_make_descr_binop(_div)descr_truediv,descr_rtruediv=_make_descr_binop(_truediv)descr_mod,descr_rmod=_make_descr_binop(_mod)descr_divmod,descr_rdivmod=_make_descr_binop(_divmod,ovf2small=_divmod_ovf2small)defsetup_prebuilt(space):ifspace.config.objspace.std.withprebuiltint:W_IntObject.PREBUILT=[]foriinrange(space.config.objspace.std.prebuiltintfrom,space.config.objspace.std.prebuiltintto):W_IntObject.PREBUILT.append(W_IntObject(i))else:W_IntObject.PREBUILT=Nonedefwrapint(space,x):ifnotspace.config.objspace.std.withprebuiltint:returnW_IntObject(x)lower=space.config.objspace.std.prebuiltintfromupper=space.config.objspace.std.prebuiltintto# use r_uint to perform a single comparison (this whole function is# getting inlined into every caller so keeping the branching to a# minimum is a good idea)index=r_uint(x-lower)ifindex>=r_uint(upper-lower):w_res=instantiate(W_IntObject)else:w_res=W_IntObject.PREBUILT[index]# obscure hack to help the CPU cache: we store 'x' even into a# prebuilt integer's intval. This makes sure that the intval field# is present in the cache in the common case where it is quickly# reused. (we could use a prefetch hint if we had that)w_res.intval=xreturnw_resdef_recover_with_smalllong(space):"""True if there is a chance that a SmallLong would fit when an Int does not """return(space.config.objspace.std.withsmalllongandsys.maxint==2147483647)def_string_to_int_or_long(space,w_source,string,base=10):w_longval=Nonevalue=0try:value=string_to_int(string,base)exceptParseStringErrorase:raisewrap_parsestringerror(space,e,w_source)exceptParseStringOverflowErrorase:w_longval=_retry_to_w_long(space,e.parser,w_source)returnvalue,w_longvaldef_retry_to_w_long(space,parser,w_source):parser.rewind()try:bigint=rbigint._from_numberstring_parser(parser)exceptParseStringErrorase:raisewrap_parsestringerror(space,e,w_source)returnspace.newlong_from_rbigint(bigint)def_new_int(space,w_inttype,w_x,w_base=None):w_longval=Nonew_value=w_x# 'x' is the keyword argument name in CPythonvalue=0ifw_baseisNone:# check for easy casesiftype(w_value)isW_IntObject:value=w_value.intvalelif(space.lookup(w_value,'__int__')isnotNoneorspace.lookup(w_value,'__trunc__')isnotNone):# otherwise, use the __int__() or the __trunc__() methodsw_obj=w_valueifspace.lookup(w_obj,'__int__')isNone:w_obj=space.trunc(w_obj)w_obj=space.int(w_obj)# 'int(x)' should return what x.__int__() returned, which should# be an int or long or a subclass thereof.ifspace.is_w(w_inttype,space.w_int):returnw_obj# int_w is effectively what we want in this case,# we cannot construct a subclass of int instance with an# an overflowing longvalue=space.int_w(w_obj,allow_conversion=False)elifspace.isinstance_w(w_value,space.w_str):value,w_longval=_string_to_int_or_long(space,w_value,space.str_w(w_value))elifspace.isinstance_w(w_value,space.w_unicode):frompypy.objspace.std.unicodeobjectimportunicode_to_decimal_wstring=unicode_to_decimal_w(space,w_value)value,w_longval=_string_to_int_or_long(space,w_value,string)else:# If object supports the buffer interfacetry:buf=space.charbuf_w(w_value)exceptOperationErrorase:ifnote.match(space,space.w_TypeError):raiseraiseoefmt(space.w_TypeError,"int() argument must be a string or a number, ""not '%T'",w_value)else:value,w_longval=_string_to_int_or_long(space,w_value,buf)else:base=space.int_w(w_base)ifspace.isinstance_w(w_value,space.w_unicode):frompypy.objspace.std.unicodeobjectimportunicode_to_decimal_ws=unicode_to_decimal_w(space,w_value)else:try:s=space.str_w(w_value)exceptOperationErrorase:raiseoefmt(space.w_TypeError,"int() can't convert non-string with explicit ""base")value,w_longval=_string_to_int_or_long(space,w_value,s,base)ifw_longvalisnotNone:ifnotspace.is_w(w_inttype,space.w_int):raiseoefmt(space.w_OverflowError,"long int too large to convert to int")returnw_longvalelifspace.is_w(w_inttype,space.w_int):# common casereturnwrapint(space,value)else:w_obj=space.allocate_instance(W_IntObject,w_inttype)W_IntObject.__init__(w_obj,value)returnw_objW_IntObject.typedef=TypeDef("int",__doc__="""int(x=0) -> int or longint(x, base=10) -> int or longConvert a number or string to an integer, or return 0 if no argumentsare given. If x is floating point, the conversion truncates towards zero.If x is outside the integer range, the function returns a long instead.If x is not a number or if base is given, then x must be a string orUnicode object representing an integer literal in the given base. Theliteral can be preceded by '+' or '-' and be surrounded by whitespace.The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means tointerpret the base from the string as an integer literal.>>> int('0b100', base=0)4""",__new__=interp2app(W_IntObject.descr_new),numerator=typedef.GetSetProperty(W_IntObject.descr_get_numerator,doc="the numerator of a rational number in lowest terms"),denominator=typedef.GetSetProperty(W_IntObject.descr_get_denominator,doc="the denominator of a rational number in lowest terms"),real=typedef.GetSetProperty(W_IntObject.descr_get_real,doc="the real part of a complex number"),imag=typedef.GetSetProperty(W_IntObject.descr_get_imag,doc="the imaginary part of a complex number"),__repr__=interp2app(W_IntObject.descr_repr,doc=W_AbstractIntObject.descr_repr.__doc__),__str__=interp2app(W_IntObject.descr_str,doc=W_AbstractIntObject.descr_str.__doc__),conjugate=interp2app(W_IntObject.descr_conjugate,doc=W_AbstractIntObject.descr_conjugate.__doc__),bit_length=interp2app(W_IntObject.descr_bit_length,doc=W_AbstractIntObject.descr_bit_length.__doc__),__format__=interp2app(W_IntObject.descr_format,doc=W_AbstractIntObject.descr_format.__doc__),__hash__=interp2app(W_IntObject.descr_hash,doc=W_AbstractIntObject.descr_hash.__doc__),__coerce__=interp2app(W_IntObject.descr_coerce,doc=W_AbstractIntObject.descr_coerce.__doc__),__oct__=interp2app(W_IntObject.descr_oct,doc=W_AbstractIntObject.descr_oct.__doc__),__hex__=interp2app(W_IntObject.descr_hex,doc=W_AbstractIntObject.descr_hex.__doc__),__getnewargs__=interp2app(W_IntObject.descr_getnewargs,doc=W_AbstractIntObject.descr_getnewargs.__doc__),__int__=interp2app(W_IntObject.int,doc=W_AbstractIntObject.int.__doc__),__long__=interp2app(W_IntObject.descr_long,doc=W_AbstractIntObject.descr_long.__doc__),__index__=interp2app(W_IntObject.descr_index,doc=W_AbstractIntObject.descr_index.__doc__),__trunc__=interp2app(W_IntObject.descr_trunc,doc=W_AbstractIntObject.descr_trunc.__doc__),__float__=interp2app(W_IntObject.descr_float,doc=W_AbstractIntObject.descr_float.__doc__),__pos__=interp2app(W_IntObject.descr_pos,doc=W_AbstractIntObject.descr_pos.__doc__),__neg__=interp2app(W_IntObject.descr_neg,doc=W_AbstractIntObject.descr_neg.__doc__),__abs__=interp2app(W_IntObject.descr_abs,doc=W_AbstractIntObject.descr_abs.__doc__),__nonzero__=interp2app(W_IntObject.descr_nonzero,doc=W_AbstractIntObject.descr_nonzero.__doc__),__invert__=interp2app(W_IntObject.descr_invert,doc=W_AbstractIntObject.descr_invert.__doc__),__lt__=interp2app(W_IntObject.descr_lt,doc=W_AbstractIntObject.descr_lt.__doc__),__le__=interp2app(W_IntObject.descr_le,doc=W_AbstractIntObject.descr_le.__doc__),__eq__=interp2app(W_IntObject.descr_eq,doc=W_AbstractIntObject.descr_eq.__doc__),__ne__=interp2app(W_IntObject.descr_ne,doc=W_AbstractIntObject.descr_ne.__doc__),__gt__=interp2app(W_IntObject.descr_gt,doc=W_AbstractIntObject.descr_gt.__doc__),__ge__=interp2app(W_IntObject.descr_ge,doc=W_AbstractIntObject.descr_ge.__doc__),__add__=interp2app(W_IntObject.descr_add,doc=W_AbstractIntObject.descr_add.__doc__),__radd__=interp2app(W_IntObject.descr_radd,doc=W_AbstractIntObject.descr_radd.__doc__),__sub__=interp2app(W_IntObject.descr_sub,doc=W_AbstractIntObject.descr_sub.__doc__),__rsub__=interp2app(W_IntObject.descr_rsub,doc=W_AbstractIntObject.descr_rsub.__doc__),__mul__=interp2app(W_IntObject.descr_mul,doc=W_AbstractIntObject.descr_mul.__doc__),__rmul__=interp2app(W_IntObject.descr_rmul,doc=W_AbstractIntObject.descr_rmul.__doc__),__and__=interp2app(W_IntObject.descr_and,doc=W_AbstractIntObject.descr_and.__doc__),__rand__=interp2app(W_IntObject.descr_rand,doc=W_AbstractIntObject.descr_rand.__doc__),__or__=interp2app(W_IntObject.descr_or,doc=W_AbstractIntObject.descr_or.__doc__),__ror__=interp2app(W_IntObject.descr_ror,doc=W_AbstractIntObject.descr_ror.__doc__),__xor__=interp2app(W_IntObject.descr_xor,doc=W_AbstractIntObject.descr_xor.__doc__),__rxor__=interp2app(W_IntObject.descr_rxor,doc=W_AbstractIntObject.descr_rxor.__doc__),__lshift__=interp2app(W_IntObject.descr_lshift,doc=W_AbstractIntObject.descr_lshift.__doc__),__rlshift__=interp2app(W_IntObject.descr_rlshift,doc=W_AbstractIntObject.descr_rlshift.__doc__),__rshift__=interp2app(W_IntObject.descr_rshift,doc=W_AbstractIntObject.descr_rshift.__doc__),__rrshift__=interp2app(W_IntObject.descr_rrshift,doc=W_AbstractIntObject.descr_rrshift.__doc__),__floordiv__=interp2app(W_IntObject.descr_floordiv,doc=W_AbstractIntObject.descr_floordiv.__doc__),__rfloordiv__=interp2app(W_IntObject.descr_rfloordiv,doc=W_AbstractIntObject.descr_rfloordiv.__doc__),__div__=interp2app(W_IntObject.descr_div,doc=W_AbstractIntObject.descr_div.__doc__),__rdiv__=interp2app(W_IntObject.descr_rdiv,doc=W_AbstractIntObject.descr_rdiv.__doc__),__truediv__=interp2app(W_IntObject.descr_truediv,doc=W_AbstractIntObject.descr_truediv.__doc__),__rtruediv__=interp2app(W_IntObject.descr_rtruediv,doc=W_AbstractIntObject.descr_rtruediv.__doc__),__mod__=interp2app(W_IntObject.descr_mod,doc=W_AbstractIntObject.descr_mod.__doc__),__rmod__=interp2app(W_IntObject.descr_rmod,doc=W_AbstractIntObject.descr_rmod.__doc__),__divmod__=interp2app(W_IntObject.descr_divmod,doc=W_AbstractIntObject.descr_divmod.__doc__),__rdivmod__=interp2app(W_IntObject.descr_rdivmod,doc=W_AbstractIntObject.descr_rdivmod.__doc__),__pow__=interp2app(W_IntObject.descr_pow,doc=W_AbstractIntObject.descr_pow.__doc__),__rpow__=interp2app(W_IntObject.descr_rpow,doc=W_AbstractIntObject.descr_rpow.__doc__),)