Zheaoli commented on code in PR #3514:
URL:
https://github.com/apache/incubator-opendal/pull/3514#discussion_r1386123571
##########
bindings/python/python/opendal/__init__.pyi:
##########
@@ -73,6 +73,8 @@ class AsyncOperator:
async def copy(self, source: str, target: str): ...
async def rename(self, source: str, target: str): ...
async def remove_all(self, path: str): ...
+ @property
+ def operator(self) -> Operator: ...
Review Comment:
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
--
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]