Rust bindings for the Python interpreter
688 matches across 12 categories. Click a row to expand file-level details.
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | guide/src/class.md | 241 | ) -> PyResult<()> { |
| LOW | guide/src/class.md | 261 | # }); |
| LOW | guide/src/class.md | 501 | if val % 2 == 0 { |
| LOW | guide/src/class.md | 841 | - For details on `parameter-list`, see the documentation of `Method arguments` section. |
| LOW | guide/src/class.md | 1081 | // similarly for classmethod arguments, use $cls |
| LOW | guide/src/class.md | 1101 | # if cfg!(not(Py_LIMITED_API)) || py.version_info() >= (3, 10) { |
| LOW | guide/src/class.md | 1121 | # |
| LOW | guide/src/class.md | 1141 | # { |
| LOW | guide/src/parallelism.md | 41 | ``` |
| LOW | guide/src/parallelism.md | 61 | ``` |
| LOW | guide/src/function.md | 121 | #[pyfunction] |
| LOW | guide/src/function.md | 141 | # let catch_warnings = warnings |
| LOW | guide/src/function.md | 161 | # assert_eq!( |
| LOW | guide/src/migration.md | 721 | ```rust,ignore |
| LOW | guide/src/trait-bounds.md | 181 | # #[pyclass] |
| LOW | guide/src/trait-bounds.md | 201 | # .call_method("get_results", (), None) |
| LOW | guide/src/trait-bounds.md | 341 | # use pyo3::types::PyList; |
| LOW | guide/src/trait-bounds.md | 361 | .unwrap() |
| LOW | guide/src/trait-bounds.md | 381 | # .unwrap(); |
| LOW | guide/src/trait-bounds.md | 421 | py_result.extract() |
| LOW | guide/src/conversions/traits.md | 1 | # Conversion traits |
| LOW | guide/src/conversions/traits.md | 41 | |
| LOW | guide/src/conversions/traits.md | 81 | # let dict = PyDict::new(py); |
| LOW | guide/src/conversions/traits.md | 101 | string_attr: String, |
| LOW | guide/src/conversions/traits.md | 141 | bar: String, |
| LOW | guide/src/conversions/traits.md | 161 | Tuple structs are also supported but do not allow customizing the extraction. |
| LOW | guide/src/conversions/traits.md | 221 | inner: String, |
| LOW | guide/src/conversions/traits.md | 281 | # let rust_thing: RustyEnum<'_> = thing.extract()?; |
| LOW | guide/src/conversions/traits.md | 301 | # ); |
| LOW | guide/src/conversions/traits.md | 321 | # match rust_thing { |
| LOW | guide/src/conversions/traits.md | 341 | # let rust_thing: RustyEnum<'_> = instance.extract()?; |
| LOW | guide/src/conversions/traits.md | 361 | # )?; |
| LOW | guide/src/conversions/traits.md | 381 | # b"text", |
| LOW | guide/src/conversions/traits.md | 401 | enum RustyEnum { |
| LOW | guide/src/conversions/traits.md | 421 | # } |
| LOW | guide/src/conversions/traits.md | 501 | # // Filled case |
| LOW | guide/src/function/signature.md | 141 | |
| LOW | guide/src/function/signature.md | 201 | # let fun = pyo3::wrap_pyfunction!(add, py)?; |
| LOW | guide/src/function/signature.md | 241 | } |
| LOW | guide/src/function/error-handling.md | 161 | } |
| LOW | guide/src/class/numeric.md | 341 | # n = Number(ord(x)) + ((n << five) - n) |
| LOW | guide/src/class/numeric.md | 361 | # assert Number(13) < Number(20) |
| LOW | guide/src/class/numeric.md | 381 | # pass |
| LOW | guide/src/class/object.md | 41 | ## String representations |
| LOW | guide/src/class/object.md | 281 | # let y = &Bound::new(py, Number(4))?; |
| LOW | pyo3-ffi/src/methodobject.rs | 141 | } |
| LOW | pyo3-ffi/src/methodobject.rs | 161 | |
| LOW | pyo3-ffi/src/lib.rs | 1 | #![no_std] |
| LOW | pyo3-ffi/src/lib.rs | 21 | //! - The vast majority can only be used safely while the thread is attached to the Python interpreter. |
| LOW | pyo3-ffi/src/lib.rs | 41 | //! PyO3 uses `rustc`'s `--cfg` flags to enable or disable code used for different Python versions. |
| LOW | pyo3-ffi/src/lib.rs | 61 | //! To use these attributes, add [`pyo3-build-config`] as a build dependency in |
| LOW | pyo3-ffi/src/lib.rs | 81 | //! - CPython 3.8 or greater |
| LOW | pyo3-ffi/src/lib.rs | 101 | //! # Downstream Rust code (including code in `bin/`, `examples/`, and `tests/`) will not be able |
| LOW | pyo3-ffi/src/lib.rs | 121 | //! **`build.rs`** |
| LOW | pyo3-ffi/src/lib.rs | 141 | //! m_base: PyModuleDef_HEAD_INIT, |
| LOW | pyo3-ffi/src/lib.rs | 161 | //! // A zeroed PyMethodDef to mark the end of the array. |
| LOW | pyo3-ffi/src/lib.rs | 181 | //! slot: 0, |
| LOW | pyo3-ffi/src/lib.rs | 201 | //! // The module initialization function |
| LOW | pyo3-ffi/src/lib.rs | 221 | //! "sum_as_string expected an int for positional argument {}\0", |
| LOW | pyo3-ffi/src/lib.rs | 241 | //! Some(i) |
| 528 more matches not shown… | |||
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | noxfile.py | 66 | def _parse_supported_interpreter_version( |
| LOW | noxfile.py | 80 | def _supported_interpreter_versions( |
| LOW | noxfile.py | 251 | def _clippy_additional_workspaces(session: nox.Session) -> bool: |
| LOW | noxfile.py | 469 | def test_cross_compilation_windows(session: nox.Session): |
| LOW | noxfile.py | 1132 | def set_msrv_package_versions(session: nox.Session): |
| LOW | noxfile.py | 1367 | def _iter_extern_libpython_blocks(source: str) -> Iterator[str]: |
| LOW | noxfile.py | 1392 | def _cfg_attr_is_non_cpython_only(attr: str) -> bool: |
| LOW | noxfile.py | 1712 | def _run_cargo_set_package_version( |
| LOW | examples/word-count/tests/test_word_count.py | 35 | def test_word_count_rust_parallel(benchmark, contents): |
| LOW | examples/word-count/tests/test_word_count.py | 40 | def test_word_count_rust_sequential(benchmark, contents): |
| LOW | examples/word-count/tests/test_word_count.py | 45 | def test_word_count_python_sequential(benchmark, contents): |
| LOW | examples/word-count/tests/test_word_count.py | 50 | def run_rust_sequential_twice( |
| LOW | examples/word-count/tests/test_word_count.py | 60 | def test_word_count_rust_sequential_twice_with_threads(benchmark, contents): |
| LOW | pytests/tests/test_sequence.py | 10 | def test_vec_from_list_pystring(): |
| LOW | pytests/tests/test_sequence.py | 30 | def test_rust_array_from_array(): |
| LOW | pytests/tests/test_misc.py | 23 | def test_multiple_imports_same_interpreter_ok(): |
| LOW | pytests/tests/test_misc.py | 41 | def test_import_in_subinterpreter_forbidden(): |
| LOW | pytests/tests/test_misc.py | 67 | def test_type_fully_qualified_name_includes_module(): |
| LOW | pytests/tests/test_hammer_attaching_in_thread.py | 27 | def test_hammer_attaching_in_thread(): |
| LOW | pytests/tests/test_enums.py | 5 | def test_complex_enum_variant_constructors(): |
| LOW | pytests/tests/test_enums.py | 39 | def test_complex_enum_variant_subclasses(variant: enums.ComplexEnum): |
| LOW | pytests/tests/test_enums.py | 43 | def test_complex_enum_field_getters(): |
| LOW | pytests/tests/test_enums.py | 74 | def test_complex_enum_desugared_match(variant: enums.ComplexEnum): |
| LOW | pytests/tests/test_enums.py | 105 | def test_complex_enum_pyfunction_in_out_desugared_match(variant: enums.ComplexEnum): |
| LOW | pytests/tests/test_enums.py | 126 | def test_tuple_enum_variant_constructors(): |
| LOW | pytests/tests/test_enums.py | 142 | def test_tuple_enum_variant_subclasses(variant: enums.TupleEnum): |
| LOW | pytests/tests/test_enums.py | 153 | def test_tuple_enum_field_getters(): |
| LOW | pytests/tests/test_enums.py | 160 | def test_tuple_enum_index_getter(): |
| LOW | pytests/tests/test_enums.py | 170 | def test_mixed_complex_enum_pyfunction_instance_nothing( |
| LOW | pytests/tests/test_enums.py | 183 | def test_mixed_complex_enum_pyfunction_instance_empty(variant: enums.MixedComplexEnum): |
| LOW | pytests/tests/test_datetime.py | 159 | def test_invalid_time_fails_overflow(args): |
| LOW | pytests/tests/test_datetime.py | 229 | def test_invalid_datetime_fails(): |
| LOW | pytests/tests/test_datetime.py | 241 | def test_datetime_from_timestamp(dt): |
| LOW | pytests/tests/test_datetime.py | 259 | def test_datetime_from_timestamp_tzinfo(): |
| LOW | pytests/tests/test_datetime.py | 325 | def test_tz_class_introspection(): |
| LOW | pytests/tests/test_enums_match.py | 16 | def test_complex_enum_match_statement(variant: enums.ComplexEnum): |
| LOW | pytests/tests/test_enums_match.py | 44 | def test_complex_enum_pyfunction_in_out(variant: enums.ComplexEnum): |
| LOW | pytests/tests/test_enums_match.py | 68 | def test_complex_enum_partial_match(variant: enums.ComplexEnum): |
| LOW | pytests/tests/test_enums_match.py | 83 | def test_tuple_enum_match_statement(variant: enums.TupleEnum): |
| LOW | pytests/tests/test_enums_match.py | 103 | def test_simple_tuple_enum_match_statement(variant: enums.SimpleTupleEnum): |
| LOW | pytests/tests/test_enums_match.py | 119 | def test_tuple_enum_match_match_args(variant: enums.TupleEnum): |
| LOW | pytests/tests/test_enums_match.py | 136 | def test_tuple_enum_partial_match(variant: enums.TupleEnum): |
| LOW | pytests/tests/test_enums_match.py | 151 | def test_mixed_complex_enum_match_statement(variant: enums.MixedComplexEnum): |
| LOW | pytests/tests/test_pyclasses.py | 131 | def test_no_constructor_defined_propagates_cause(cls: Type, exc_message: str): |
| LOW | pytests/tests/test_pyfunctions.py | 66 | def test_simple_args_kwargs_py(benchmark): |
| LOW | pytests/tests/test_pyfunctions.py | 70 | def test_simple_args_kwargs_rs(benchmark): |
| LOW | pytests/tests/test_pyfunctions.py | 120 | def many_keyword_arguments_py( |
| LOW | pytests/tests/test_pyfunctions.py | 141 | def call_with_many_keyword_arguments(f) -> Any: |
| LOW | pytests/tests/test_pyfunctions.py | 160 | def test_many_keyword_arguments_py(benchmark): |
| LOW | pytests/tests/test_pyfunctions.py | 164 | def test_many_keyword_arguments_rs(benchmark): |
| LOW | pytests/tests/test_objstore.py | 7 | def test_objstore_doesnot_leak_memory(): |
| LOW | pytests/tests/test_path.py | 27 | def test_take_invalid_pathlike(): |
| Severity | File | Line | Snippet |
|---|---|---|---|
| HIGH | examples/plugin/python_plugin/gadget_init_plugin.py | 8 | g.push(1) |
| HIGH | examples/plugin/python_plugin/gadget_init_plugin.py | 9 | g.push(2) |
| HIGH | examples/plugin/python_plugin/gadget_init_plugin.py | 10 | g.push(3) |
| HIGH | examples/plugin/plugin_api/tests/test_Gadget.py | 22 | gadget.push(42) |
| HIGH | pytests/tests/test_objstore.py | 23 | store.push(message) |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | noxfile.py | 258 | except Exception: |
| LOW | noxfile.py | 267 | except Exception: |
| LOW | noxfile.py | 321 | except Exception: |
| LOW | noxfile.py | 375 | except Exception: |
| LOW | noxfile.py | 932 | except Exception: |
| LOW | guide/src/migration.md | 1626 | except Exception as e: |
| LOW | guide/src/debugging.md | 315 | except Exception: |
| LOW | guide/src/debugging.md | 322 | except Exception as e: |
| MEDIUM | guide/src/debugging.md | 323 | print(f"Error updating launch.json: {e}") |
| LOW | tests/test_inheritance.rs | 168 | except Exception as e: |
| LOW | pytests/tests/test_datetime.py | 98 | except Exception: |
| LOW | pytests/tests/test_datetime.py | 104 | except Exception as pdt_fail: |
| LOW | pytests/tests/test_datetime.py | 244 | except Exception: |
| LOW | pytests/tests/test_datetime.py | 250 | except Exception as pdt_fail: |
| MEDIUM | pytests/tests/test_datetime.py | 95 | def test_date_from_timestamp(d): |
| MEDIUM | pytests/tests/test_datetime.py | 241 | def test_datetime_from_timestamp(dt): |
| LOW | pytests/tests/test_pyclasses.py | 136 | except Exception: |
| LOW | src/types/traceback.rs | 157 | except Exception as e: |
| Severity | File | Line | Snippet |
|---|---|---|---|
| MEDIUM | guide/glossary_linker.py | 66 | # --------------------------------------------------------------------------- |
| MEDIUM | guide/glossary_linker.py | 68 | # --------------------------------------------------------------------------- |
| MEDIUM | guide/glossary_linker.py | 183 | # --------------------------------------------------------------------------- |
| MEDIUM | guide/glossary_linker.py | 185 | # --------------------------------------------------------------------------- |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | noxfile.py | 641 | |
| LOW | noxfile.py | 809 | |
| LOW | noxfile.py | 1132 | |
| LOW | noxfile.py | 1338 | |
| LOW | noxfile.py | 1367 | |
| LOW | guide/glossary_linker.py | 84 | |
| LOW | pytests/tests/test_enums.py | 74 | |
| LOW | pytests/tests/test_enums.py | 105 |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | examples/plugin/plugin_api/tests/test_import.py | 2 | |
| LOW | examples/maturin-starter/maturin_starter/__init__.py | 2 | |
| LOW | examples/maturin-starter/maturin_starter/__init__.py | 6 | |
| LOW | examples/word-count/word_count/__init__.py | 1 | |
| LOW | examples/word-count/word_count/__init__.py | 1 | |
| LOW | examples/word-count/word_count/__init__.py | 1 | |
| LOW | …tools-rust-starter/setuptools_rust_starter/__init__.py | 2 | |
| LOW | …tools-rust-starter/setuptools_rust_starter/__init__.py | 6 |
| Severity | File | Line | Snippet |
|---|---|---|---|
| MEDIUM | pytests/tests/test_enums_match.py | 1 | # This file is only collected when Python >= 3.10, because it tests match syntax. |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | .github/workflows/ci.yml | 897 | # Check if all needs were successful or skipped. |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | src/pyclass.rs | 65 | /// Usage example: |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | src/pycell/impl_.rs | 268 | // For `#[pyclass]` types which inherit from PyAny, we can just call tp_free |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | guide/src/python-from-rust/calling-existing-code.md | 332 | let house = house_class.call1(("123 Main Street",)).unwrap(); |