messense commented on code in PR #3464:
URL:
https://github.com/apache/incubator-opendal/pull/3464#discussion_r1379685844
##########
bindings/python/src/layers.rs:
##########
@@ -92,14 +71,18 @@ impl RetryLayer {
if let Some(min_delay) = min_delay {
retry = retry.with_min_delay(Duration::from_micros((min_delay *
1000000.0) as u64));
}
- Ok(Self(retry))
+
+ let retry_layer = Self(retry);
+ let class =
PyClassInitializer::from(Layer(Box::new(retry_layer.clone())))
+ .add_subclass(retry_layer);
+
+ Ok(class)
}
}
pub fn create_submodule(py: Python) -> PyResult<&PyModule> {
let submod = PyModule::new(py, "layers")?;
- submod.add_class::<ConcurrentLimitLayer>()?;
- submod.add_class::<ImmutableIndexLayer>()?;
+ submod.add_class::<Layer>()?;
Review Comment:
I wonder that happens when user subclass `Layer` in Python, maybe we
shouldn't export `Layer` type to Python just yet?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]