Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PyO3/pyo3
/ functions
Functions
4,885 in github.com/PyO3/pyo3
⨍
Functions
4,885
◇
Types & classes
1,305
↳
Endpoints
2
Method
new
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
Method
new
Creates a Python `UnicodeDecodeError`.
src/exceptions.rs:716
Method
new
()
src/pycell.rs:718
Method
new
(init: T, super_init: <T::BaseType as PyClassBaseType>::Initializer)
src/pyclass_init.rs:74
Method
new
Create a `GILOnceCell` which does not yet contain a value.
src/sync.rs:81
Method
new
(expr: &'static PyStaticExpr, introspection_id: &'static str)
src/inspect.rs:445
Method
new
(py: Python<'_>)
src/types/typeobject.rs:42
Method
new
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
Method
new
( py: Python<'_>, value: T, name: Option<CString>, )
src/types/capsule.rs:172
Method
new
Creates a new empty dictionary.
src/types/dict.rs:58
Method
new
Creates a new Python int object. Panics if out of memory.
src/types/int.rs:41
Method
new
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
Method
new
Creates a new frozendict from an iterator of key/value pairs.
src/types/frozendict.rs:56
Method
new
Creates a new `PySliceIndices`.
src/types/slice.rs:74
Method
new
Creates a new Python bytearray object. The byte string is initialized by copying the data from the `&[u8]`.
src/types/bytearray.rs:45
Method
new
Creates a new Python `range` object with a default step of 1.
src/types/range.rs:38
Method
new
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
Method
new
Creates a new Python string object. Panics if out of memory.
src/types/string.rs:182
Method
new
Create a new `FrozenSetBuilder`. Since this allocates a `PyFrozenSet` internally it may panic when running out of memory.
src/types/frozenset.rs:29
Method
new
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
Method
new
Creates a mappingproxy from an object.
src/types/mappingproxy.rs:46
Method
new
Creates a new Python `float` object.
src/types/float.rs:61
Method
new
Creates a new `datetime.date`.
src/types/datetime.rs:238
Method
new
( py: Python<'py>, elements: impl IntoIterator<Item = T, IntoIter = U>, )
src/types/tuple.rs:153
Method
new
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
Method
new
Creates a new frame object.
src/types/frame.rs:27
Method
new
( py: Python<'py>, elements: impl IntoIterator<Item = T>, )
src/types/list.rs:87
Method
new
( py: Python<'py>, elements: impl IntoIterator<Item = T>, )
src/types/set.rs:69
Method
new
( py: Python<'py>, next: Option<Bound<'py, PyTraceback>>, frame: Bound<'py, PyFrame>,
src/types/traceback.rs:51
Method
new
(py: Python<'_>, val: bool)
src/types/boolobject.rs:50
Method
new
use pyo3::prelude::*; use pyo3::types::PyWeakrefReference; #[pyclass(weakref)] struct Foo { /* fields omitted */ } # fn main() -> PyResult<()> { Pyt
src/types/weakref/reference.rs:87
Method
new
(object: &Bound<'py, PyAny>)
src/types/weakref/proxy.rs:78
Method
new
(py: Python<'_>)
src/pyclass/guard.rs:957
Method
new
# 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
Method
new
Create a new `CoroutineCancel`.
src/coroutine/cancel.rs:22
Method
new
()
src/coroutine/waker.rs:20
Method
new
()
src/pycell/impl_.rs:123
Method
new
()
src/internal/state.rs:212
Method
new
()
src/platform/sync.rs:28
Method
new
(init: fn() -> T)
src/platform/thread/thread_local.rs:49
Method
new
(a: u8)
src/tests/hygiene/pymethods.rs:398
Method
new
()
src/sync/mutex.rs:20
Method
new
Create a new mutex in an unlocked state ready for use.
src/sync/nonpoison.rs:74
Method
new
Create a `PyOnceLock` which does not yet contain a value.
src/sync/once_lock.rs:44
Method
new
(pvalue: Bound<'_, PyBaseException>)
src/err/err_state.rs:147
Method
new
(args: A)
src/err/mod.rs:127
Method
new
(from: Borrowed<'a, 'py, PyAny>, classinfo: Bound<'py, PyAny>)
src/err/cast_error.rs:30
Method
new
(def: ffi::PyMethodDef)
src/impl_/pyfunction.rs:21
Method
new
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
Method
new
(module: &'static str, name: &'static str)
src/impl_/exceptions.rs:10
Method
new
()
src/impl_/freelist.rs:24
Method
new
Compact constructor used by the macros to keep the generated code small.
src/impl_/extract_argument.rs:518
Method
new
Define a class attribute.
src/impl_/pymethods.rs:257
Method
new
(_: &T)
src/impl_/wrap.rs:30
Method
new
()
src/impl_/pyclass.rs:171
Method
new
Make new module definition with given module name.
src/impl_/pymodule.rs:73
Method
new
(msg: &'static str)
src/impl_/panic.rs:12
Method
new
()
src/impl_/pyclass/lazy_type_object.rs:43
Method
new
(x: i32, y: i32)
src/impl_/pyclass/doc.rs:77
Method
new
()
tests/test_inheritance.rs:99
Method
new
(future: Py<PyAny>)
tests/test_proto_methods.rs:745
Method
new
(elements: Option<&Bound<'_, PyList>>)
tests/test_mapping.rs:24
Method
new
(feature_required: bool)
tests/test_compile_error.rs:411
Method
new
()
tests/test_methods.rs:92
Method
new
(value: f64)
tests/test_arithmetics.rs:17
Method
new
(_args: Bound<'_, PyAny>, _kwargs: Option<Bound<'_, PyAny>>)
tests/test_pyfunction.rs:715
Method
new
(elements: Option<&Bound<'_, PyList>>)
tests/test_sequence.rs:22
Method
new
(value: usize)
tests/test_module.rs:22
Method
new
()
tests/test_various.rs:126
Method
new
()
tests/test_class_attributes.rs:210
Method
new
()
tests/test_gc.rs:265
Method
new
()
tests/test_class_new.rs:14
Method
new
(a: i32, b: i32, c: i32)
tests/test_text_signature.rs:199
Method
new
()
tests/test_class_init.rs:13
Method
new
(value: usize)
tests/test_declarative_module.rs:30
Method
new
(value: Py<PyAny>)
tests/test_class_basics.rs:216
Method
new
()
tests/test_coroutine.rs:62
Method
new
()
tests/test_super.rs:14
Method
new
()
tests/test_static_slots.rs:17
Method
new
()
tests/test_multiple_pymethods.rs:15
Method
new
(&self)
tests/ui/invalid_pymethod_names.rs:29
Method
new
()
tests/ui/deprecated_super_init.rs:14
Method
new
()
tests/ui/pyclass_probe.rs:14
Method
new
()
tests/ui/invalid_pyclass_generic.rs:15
Method
new
(field: i32)
tests/ui/invalid_pyclass_args.rs:274
Method
new
()
tests/ui/invalid_pyclass_new.rs:15
Method
new
()
examples/plugin/plugin_api/src/lib.rs:15
Method
new
()
examples/getitem/src/lib.rs:21
Method
new
(value: i32)
examples/setuptools-rust-starter/src/lib.rs:16
Method
new
(value: i32)
examples/meson-starter/src/lib.rs:16
Method
new
(value: i32)
examples/maturin-starter/src/lib.rs:16
Method
new_1
()
tests/ui/invalid_pymethods_duplicates.rs:14
Method
new_2
()
tests/ui/invalid_pymethods_duplicates.rs:19
Function
new_byteswriter_is_empty
()
src/types/bytes/writer.rs:236
Method
new_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
Function
new_coroutine
( name: &Bound<'py, PyString>, qualname_prefix: Option<&'static str>, throw_callback: Option<Throw
src/impl_/coroutine.rs:10
Method
new_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
Function
new_impl
()
tests/test_class_attributes.rs:250
Function
new_impl_tuple_struct
()
tests/test_class_attributes.rs:266
Function
new_proxy
(object: &Bound<'py, PyAny>)
src/types/weakref/anyref.rs:354
← previous
next →
3,101–3,200 of 4,885, ranked by callers