Convert a number or string to an integer, or return 0 if no arguments
are 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 or
Unicode object representing an integer literal in the given base. The
literal 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 to
interpret the base from the string as an integer literal. >>>
int('0b100', base=0) 4
|
|
|
|
|
|
|
|
|
__coerce__(x,
y)
coerce(x, y) |
|
|
|
|
|
__divmod__(x,
y)
divmod(x, y) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__index__(...)
x[y:z] <==> x[y.__index__():z.__index__()] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
a new object with type S, a subtype of T
|
|
|
|
|
|
|
|
|
|
|
__pow__(x,
y,
z=...)
pow(x, y[, z]) |
|
|
|
|
|
|
|
|
|
__rdivmod__(x,
y)
divmod(y, x) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__rpow__(y,
x,
z=...)
pow(x, y[, z]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__trunc__(...)
Truncating an Integral returns itself. |
|
|
|
|
int
|
bit_length(int)
Number of bits necessary to represent self in binary. |
|
|
|
conjugate(...)
Returns self, the complex conjugate of any int. |
|
|
Inherited from object :
__delattr__ ,
__init__ ,
__reduce__ ,
__reduce_ex__ ,
__setattr__ ,
__sizeof__ ,
__subclasshook__
|