{"record":{"id":"a9cc7d5b537fc624","repo":"slint-ui/slint","slug":"not-implemented-a9cc7d","errorCode":null,"errorMessage":"not implemented","messagePattern":"not implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"api/python/slint/interpreter.rs","lineNumber":440,"sourceCode":"            | Type::Int32\n            | Type::Duration\n            | Type::Angle\n            | Type::PhysicalLength\n            | Type::LogicalLength\n            | Type::Percent\n            | Type::Rem\n            | Type::UnitProduct(_) => PyValueType::Number,\n            Type::String => PyValueType::String,\n            Type::Array(..) => PyValueType::Model,\n            Type::Struct { .. } => PyValueType::Struct,\n            Type::Brush => PyValueType::Brush,\n            Type::Color => PyValueType::Brush,\n            Type::Image => PyValueType::Image,\n            Type::StyledText => PyValueType::StyledText,\n            Type::Enumeration(..) => PyValueType::Enumeration,\n            Type::Keys => PyValueType::Keys,\n            Type::MouseCursor => PyValueType::MouseCursor,\n            _ => unimplemented!(),\n        }\n    }\n}\n\n#[pyclass(unsendable, weakref)]\npub struct ComponentInstance {\n    instance: slint_interpreter::ComponentInstance,\n    callbacks: GcVisibleCallbacks,\n    global_callbacks: HashMap<String, GcVisibleCallbacks>,\n    type_collection: TypeCollection,\n}\n\n#[pymethods]\nimpl ComponentInstance {\n    #[getter]\n    fn definition(&self) -> ComponentDefinition {\n        ComponentDefinition {\n            definition: self.instance.definition(),","sourceCodeStart":422,"sourceCodeEnd":458,"githubUrl":"https://github.com/slint-ui/slint/blob/a9ea814a5813e7460fa1a867924872095a4d678d/api/python/slint/interpreter.rs#L422-L458","documentation":"The Python interpreter binding converts the compiler's Type enum into a PyValueType to decide how values cross the FFI. Numeric/unit types, String, Array (model), Struct, Brush/Color, Image, StyledText, Enumeration, Keys and MouseCursor are mapped; every other Type falls into `_ => unimplemented!()` and panics (surfaced in Python as a Rust panic). It marks type kinds that the Python API currently cannot represent as property/callback values.","triggerScenarios":"Via slint.load_file/load_str on the Python interpreter path: a property or callback signature whose type has no Python representation (e.g. easing-kind values, element-reference/component-factory internals, or invalid/inferred types escaping compilation), then instantiating the component or touching the value.","commonSituations":"Using a newly introduced Slint type in public properties before the Python binding learns it; exposing internal types through `out property` on the root; mismatched slint-python package vs. markup written against a newer release.","solutions":["Don't expose the offending type as a property/callback of the component used from Python; keep such values internal to the .slint file.","Update the slint Python package — newer versions map more Type variants.","If it reproduces on the latest release, reduce the .slint to the triggering property and report it upstream."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# Smoke-test: load and instantiate the component once at startup with a top-level guard\nimport faulthandler, sys\ntry:\n    module = slint.load_file(\"app.slint\")\n    probe = getattr(module, \"App\")()\nexcept BaseException as e:  # Rust panics surface here on the interpreter path\n    print(f\"component rejected by the Python binding: {e}\", file=sys.stderr)\n    sys.exit(1)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep exotic types (easing, element references, factories) out of public properties/callbacks used from Python.","Instantiate each component once in a startup self-test to catch unmappable types before the loop runs.","Track slint release notes for newly supported Type variants and upgrade the package accordingly."],"tags":["python","interpreter","types","panic","bindings"],"backgroundTag":"unsupported-type-conversion","analyzedSha":"a9ea814a5813e7460fa1a867924872095a4d678d","analyzedAt":"2026-08-16T22:39:12.830Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}