messense commented on code in PR #3464:
URL:
https://github.com/apache/incubator-opendal/pull/3464#discussion_r1379695479
##########
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:
> In fact, I'm not sure about this. Can users from python implement this
trait?
I think they can't because `Layer` lacks `#[new]` so it can't be constructed
from Python, so probably fine to leave it as-is.
--
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]