Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add type hints to SyncNode #1438

Merged
merged 1 commit into from
Sep 13, 2023

Conversation

okapies
Copy link
Contributor

@okapies okapies commented Sep 12, 2023

  • Add type hints to SyncNode
  • Fix a type hint of Node.add_reference()
  • Add the missing methods to SyncNode:
    • add_reference_type()
    • delete_reference()
    • get_access_level()
    • get_description_refs()
    • get_encoding_refs()
    • get_methods()
    • get_referenced_nodes()
    • read_data_type_definition()
    • read_event_notifier()
    • register()
    • set_attr_bit()
    • set_event_notifier()
    • unregister()
    • unset_attr_bit()
    • write_array_dimensions()
    • write_data_type_definition()
    • write_value_rank()

@@ -285,7 +296,7 @@ def load_type_definitions(self, nodes=None):
pass

@syncmethod
def load_data_type_definitions(self, node: Optional["SyncNode"] = None, overwrite_existing: bool = False) -> Dict[str, Type]: # type: ignore[empty-body]
def load_data_type_definitions(self, node: Optional[SyncNode] = None, overwrite_existing: bool = False) -> Dict[str, Type]: # type: ignore[empty-body]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should also anotate the __init__method with reutrn value None so it gets checked by mypy. I have seen that you always skip that one into your MRs, but otherwise it looks good

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I'll put them later.

@oroulet oroulet merged commit 5071b60 into FreeOpcUa:master Sep 13, 2023
5 checks passed
@okapies okapies deleted the feature/typing-syncnode-1 branch September 13, 2023 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants