Skip to content

feat: Use factory mode to init the operator instance in Python binding #3537

@Zheaoli

Description

@Zheaoli
          This could be better
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 #3514 (comment)

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions