Skip to main content

Crate use_python_value

Crate use_python_value 

Source
Expand description

§use-python-value

Python-like primitive value metadata for RustUse.

§Experimental

use-python-value is experimental while use-python remains below 0.3.0.

§Example

use use_python_value::PythonPrimitiveValue;

let value = PythonPrimitiveValue::Int(String::from("12345678901234567890"));

assert_eq!(value.type_name(), "int");
assert!(value.is_numeric());
assert!(value.is_truthy_like());

§Scope

  • Primitive Python-like value metadata.
  • Truthy-like and numeric classification helpers.
  • Text storage for large integer literals without arbitrary-precision dependencies.

§Non-goals

  • Full Python object semantics.
  • Arbitrary-precision math.
  • Evaluating Python literals or source code.

§License

Licensed under either Apache-2.0 or MIT.

Structs§

PythonBytesValue
Python bytes value metadata.
PythonEllipsis
Python ellipsis metadata marker.
PythonNone
Python None metadata marker.

Enums§

PythonNumberValue
Primitive Python number value metadata.
PythonPrimitiveValue
Primitive Python-like values for metadata and validation helpers.
PythonStringKind
Python string literal kind metadata.
PythonValueParseError
Error returned when Python value metadata labels are invalid.