MCPcopy Create free account

hub / github.com/PyO3/pyo3 / functions

Functions4,885 in github.com/PyO3/pyo3

Methodnew
Creates a new instance `Bound<T>` of a `#[pyclass]` on the Python heap. # Examples ```rust use pyo3::prelude::*; #[pyclass] struct Foo {/* fields o
src/instance.rs:99
Methodnew
Creates a Python `UnicodeDecodeError`.
src/exceptions.rs:716
Methodnew
()
src/pycell.rs:718
Methodnew
(init: T, super_init: <T::BaseType as PyClassBaseType>::Initializer)
src/pyclass_init.rs:74
Methodnew
Create a `GILOnceCell` which does not yet contain a value.
src/sync.rs:81
Methodnew
(expr: &'static PyStaticExpr, introspection_id: &'static str)
src/inspect.rs:445
Methodnew
(py: Python<'_>)
src/types/typeobject.rs:42
Methodnew
Constructs a new super object. More read about super object: [docs](https://docs.python.org/3/library/functions.html#super) # Examples ```rust,no_ru
src/types/pysuper.rs:77
Methodnew
( py: Python<'_>, value: T, name: Option<CString>, )
src/types/capsule.rs:172
Methodnew
Creates a new empty dictionary.
src/types/dict.rs:58
Methodnew
Creates a new Python int object. Panics if out of memory.
src/types/int.rs:41
Methodnew
Creates a new module object with the `__name__` attribute set to `name`. When creating a submodule pass the full path as the name such as `top_level.
src/types/module.rs:73
Methodnew
Creates a new frozendict from an iterator of key/value pairs.
src/types/frozendict.rs:56
Methodnew
Creates a new `PySliceIndices`.
src/types/slice.rs:74
Methodnew
Creates a new Python bytearray object. The byte string is initialized by copying the data from the `&[u8]`.
src/types/bytearray.rs:45
Methodnew
Creates a new Python `range` object with a default step of 1.
src/types/range.rs:38
Methodnew
Creates a new Python GenericAlias object. origin should be a non-parameterized generic class. args should be a tuple (possibly of length 1) of types
src/types/genericalias.rs:51
Methodnew
Creates a new Python string object. Panics if out of memory.
src/types/string.rs:182
Methodnew
Create a new `FrozenSetBuilder`. Since this allocates a `PyFrozenSet` internally it may panic when running out of memory.
src/types/frozenset.rs:29
Methodnew
Creates a new Python bytestring object. The bytestring is initialized by copying the data from the `&[u8]`. Panics if out of memory.
src/types/bytes.rs:83
Methodnew
Creates a mappingproxy from an object.
src/types/mappingproxy.rs:46
Methodnew
Creates a new Python `float` object.
src/types/float.rs:61
Methodnew
Creates a new `datetime.date`.
src/types/datetime.rs:238
Methodnew
( py: Python<'py>, elements: impl IntoIterator<Item = T, IntoIter = U>, )
src/types/tuple.rs:153
Methodnew
Create a new built-in function which takes no arguments. To create `name` and `doc` static strings on Rust versions older than 1.77 (which added c""
src/types/function.rs:71
Methodnew
Creates a new frame object.
src/types/frame.rs:27
Methodnew
( py: Python<'py>, elements: impl IntoIterator<Item = T>, )
src/types/list.rs:87
Methodnew
( py: Python<'py>, elements: impl IntoIterator<Item = T>, )
src/types/set.rs:69
Methodnew
( py: Python<'py>, next: Option<Bound<'py, PyTraceback>>, frame: Bound<'py, PyFrame>,
src/types/traceback.rs:51
Methodnew
(py: Python<'_>, val: bool)
src/types/boolobject.rs:50
Methodnew
use pyo3::prelude::*; use pyo3::types::PyWeakrefReference; #[pyclass(weakref)] struct Foo { /* fields omitted */ } # fn main() -> PyResult<()> { Pyt
src/types/weakref/reference.rs:87
Methodnew
(object: &Bound<'py, PyAny>)
src/types/weakref/proxy.rs:78
Methodnew
(py: Python<'_>)
src/pyclass/guard.rs:957
Methodnew
# Safety The caller must pass a `visit` and `arg` pair that are guaranteed to be valid for the inferred lifetime `'a`.
src/pyclass/gc.rs:64
Methodnew
Create a new `CoroutineCancel`.
src/coroutine/cancel.rs:22
Methodnew
()
src/coroutine/waker.rs:20
Methodnew
()
src/pycell/impl_.rs:123
Methodnew
()
src/internal/state.rs:212
Methodnew
()
src/platform/sync.rs:28
Methodnew
(init: fn() -> T)
src/platform/thread/thread_local.rs:49
Methodnew
(a: u8)
src/tests/hygiene/pymethods.rs:398
Methodnew
()
src/sync/mutex.rs:20
Methodnew
Create a new mutex in an unlocked state ready for use.
src/sync/nonpoison.rs:74
Methodnew
Create a `PyOnceLock` which does not yet contain a value.
src/sync/once_lock.rs:44
Methodnew
(pvalue: Bound<'_, PyBaseException>)
src/err/err_state.rs:147
Methodnew
(args: A)
src/err/mod.rs:127
Methodnew
(from: Borrowed<'a, 'py, PyAny>, classinfo: Bound<'py, PyAny>)
src/err/cast_error.rs:30
Methodnew
(def: ffi::PyMethodDef)
src/impl_/pyfunction.rs:21
Methodnew
Safety: this should only be used inside a future passed to `new_coroutine`, where the coroutine is guaranteed to be attached to the thread when polled
src/impl_/coroutine.rs:28
Methodnew
(module: &'static str, name: &'static str)
src/impl_/exceptions.rs:10
Methodnew
()
src/impl_/freelist.rs:24
Methodnew
Compact constructor used by the macros to keep the generated code small.
src/impl_/extract_argument.rs:518
Methodnew
Define a class attribute.
src/impl_/pymethods.rs:257
Methodnew
(_: &T)
src/impl_/wrap.rs:30
Methodnew
()
src/impl_/pyclass.rs:171
Methodnew
Make new module definition with given module name.
src/impl_/pymodule.rs:73
Methodnew
(msg: &'static str)
src/impl_/panic.rs:12
Methodnew
()
src/impl_/pyclass/lazy_type_object.rs:43
Methodnew
(x: i32, y: i32)
src/impl_/pyclass/doc.rs:77
Methodnew
()
tests/test_inheritance.rs:99
Methodnew
(future: Py<PyAny>)
tests/test_proto_methods.rs:745
Methodnew
(elements: Option<&Bound<'_, PyList>>)
tests/test_mapping.rs:24
Methodnew
(feature_required: bool)
tests/test_compile_error.rs:411
Methodnew
()
tests/test_methods.rs:92
Methodnew
(value: f64)
tests/test_arithmetics.rs:17
Methodnew
(_args: Bound<'_, PyAny>, _kwargs: Option<Bound<'_, PyAny>>)
tests/test_pyfunction.rs:715
Methodnew
(elements: Option<&Bound<'_, PyList>>)
tests/test_sequence.rs:22
Methodnew
(value: usize)
tests/test_module.rs:22
Methodnew
()
tests/test_various.rs:126
Methodnew
()
tests/test_class_attributes.rs:210
Methodnew
()
tests/test_gc.rs:265
Methodnew
()
tests/test_class_new.rs:14
Methodnew
(a: i32, b: i32, c: i32)
tests/test_text_signature.rs:199
Methodnew
()
tests/test_class_init.rs:13
Methodnew
(value: usize)
tests/test_declarative_module.rs:30
Methodnew
(value: Py<PyAny>)
tests/test_class_basics.rs:216
Methodnew
()
tests/test_coroutine.rs:62
Methodnew
()
tests/test_super.rs:14
Methodnew
()
tests/test_static_slots.rs:17
Methodnew
()
tests/test_multiple_pymethods.rs:15
Methodnew
(&self)
tests/ui/invalid_pymethod_names.rs:29
Methodnew
()
tests/ui/deprecated_super_init.rs:14
Methodnew
()
tests/ui/pyclass_probe.rs:14
Methodnew
()
tests/ui/invalid_pyclass_generic.rs:15
Methodnew
(field: i32)
tests/ui/invalid_pyclass_args.rs:274
Methodnew
()
tests/ui/invalid_pyclass_new.rs:15
Methodnew
()
examples/plugin/plugin_api/src/lib.rs:15
Methodnew
()
examples/getitem/src/lib.rs:21
Methodnew
(value: i32)
examples/setuptools-rust-starter/src/lib.rs:16
Methodnew
(value: i32)
examples/meson-starter/src/lib.rs:16
Methodnew
(value: i32)
examples/maturin-starter/src/lib.rs:16
Methodnew_1
()
tests/ui/invalid_pymethods_duplicates.rs:14
Methodnew_2
()
tests/ui/invalid_pymethods_duplicates.rs:19
Functionnew_byteswriter_is_empty
()
src/types/bytes/writer.rs:236
Methodnew_closure
Create a new function from a closure. # Examples ``` # use pyo3::prelude::*; # use pyo3::{py_run, types::{PyCFunction, PyDict, PyTuple}}; Python::a
src/types/function.rs:102
Functionnew_coroutine
( name: &Bound<'py, PyString>, qualname_prefix: Option<&'static str>, throw_callback: Option<Throw
src/impl_/coroutine.rs:10
Methodnew_err_from_utf8
Create a new [`PyErr`](crate::PyErr) of this type from a Rust UTF-8 decoding error. This is equivalent to [`PyUnicodeDecodeError::new_utf8`], but ret
src/exceptions.rs:789
Functionnew_impl
()
tests/test_class_attributes.rs:250
Functionnew_impl_tuple_struct
()
tests/test_class_attributes.rs:266
Functionnew_proxy
(object: &Bound<'py, PyAny>)
src/types/weakref/anyref.rs:354
← previousnext →3,101–3,200 of 4,885, ranked by callers