rustpython_vm::obj::objint::PyInt - Rust
int(x=0) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance 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
impl PyInt[src]
pub fn new<T: Into<BigInt>>(i: T) -> Self[src]
pub fn as_bigint(&self) -> &BigInt[src]
impl PyInt[src]
pub fn xor(
&self,
other: PyObjectRef,
vm: &VirtualMachine
) -> PyArithmaticValue<BigInt>[src]
&self,
other: PyObjectRef,
vm: &VirtualMachine
) -> PyArithmaticValue<BigInt>
pub fn or(
&self,
other: PyObjectRef,
vm: &VirtualMachine
) -> PyArithmaticValue<BigInt>[src]
&self,
other: PyObjectRef,
vm: &VirtualMachine
) -> PyArithmaticValue<BigInt>
pub fn and(
&self,
other: PyObjectRef,
vm: &VirtualMachine
) -> PyArithmaticValue<BigInt>[src]
&self,
other: PyObjectRef,
vm: &VirtualMachine
) -> PyArithmaticValue<BigInt>
pub fn hash(&self) -> i64[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> IntoPyObject for T where
T: PyValue, [src]
T: PyValue,
fn into_pyobject(
Self,
&VirtualMachine
) -> Result<Rc<PyObject<dyn PyObjectPayload + 'static>>, PyRef<PyBaseException>>[src]
Self,
&VirtualMachine
) -> Result<Rc<PyObject<dyn PyObjectPayload + 'static>>, PyRef<PyBaseException>>
impl<T> PyObjectPayload for T where
T: 'static + PyValue, [src]
T: 'static + PyValue,
fn as_any(&Self) -> &(dyn Any + 'static)[src]
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,