feat: Use factory mode to init the operator instance in Python binding
Open
bindings/python
- Dominant language
- Rust
- Stars
- 5.4k
- Forks
- 825
- Avg merge
- 1d 14m
- Merged PRs (30d)
- 127
Description
This could be better
```python
class Operator:
@classmethod
def from_config(scheme: str, **kwargs)-> Operator: ...
@classmethod
def from_async_operator(operator: AsyncOperator) -> Operator: ...
class AsyncOperator:
@classmethod
def from_config(scheme: str, **kwargs)-> AsyncOperator: ...
@classmethod
def from_operator(operator: Operator) -> AsyncOperator: ...
```
We use the factory mode instead of `__init__` completely
_Originally posted by @Zheaoli in https://github.com/apache/incubator-opendal/pull/3514#discussion_r1386123571_
Contributor guide
Assessment
This issue has not been assessed yet.