Skip to content

Simplify typing imports and usage #270

@antaenc

Description

@antaenc

Typing/annotation can be simplified and use modern Python versions syntax as we are using from __future__ import annotations:

  • Remove unnecessary types such as Dict, List, Tuple, Union, etc from from typing import ...
  • Modify functions/methods to use native types and | instead of Union

For example:

def find_network_by_record_id(
        self,
        record_keys: List[Tuple[str, str]],
        max_degrees: int,
        build_out_degrees: int,
        build_out_max_entities: int,
        flags: int = SzEngineFlags.SZ_FIND_NETWORK_DEFAULT_FLAGS,
    ) -> str:

becomes:

def find_network_by_record_id(
        self,
        record_keys: list[tuple[str, str]],
        max_degrees: int,
        build_out_degrees: int,
        build_out_max_entities: int,
        flags: int = SzEngineFlags.SZ_FIND_NETWORK_DEFAULT_FLAGS,
    ) -> str:

Metadata

Metadata

Assignees

Labels

pythonPython programming language

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions