Skip to content

Commit 6c2eefc

Browse files
committed
Restore optional None setter helper
1 parent 5d1f2af commit 6c2eefc

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

libs/qec/python/bindings/py_decoding_config.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ void bindDecodingConfig(nb::module_ &mod) {
2929
auto mod_cfg =
3030
qecmod.def_submodule("config", "Realtime decoding configuration");
3131

32+
// Allow Python None to clear std::optional<T> fields.
33+
const auto setter_accepts_none = nb::for_setter(nb::arg("value").none());
34+
3235
// srelay_bp_config
3336
nb::class_<config::srelay_bp_config>(mod_cfg, "srelay_bp_config",
3437
"Relay-BP decoder configuration.")

0 commit comments

Comments
 (0)