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 around crypto module #1714

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

jbeckerwsi
Copy link
Contributor

No description provided.

@jbeckerwsi jbeckerwsi marked this pull request as ready for review October 2, 2024 12:06
@@ -88,7 +88,7 @@ def _process_received_data(self, data: bytes) -> None:
return
msg = self._connection.receive_from_header_and_body(header, buf)
self._process_received_message(msg)
if header.MessageType == ua.MessageType.SecureOpen:
if header.MessageType == ua.MessageType.SecureOpen and isinstance(msg,ua.Message):
Copy link
Member

Choose a reason for hiding this comment

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

that check for isinstance cannot be correct. if that is because of mypy then annotate the "recevie_from_header_xx" over

@@ -51,7 +56,7 @@ def is_chunk_count_within_limit(self, sz: int) -> bool:
_logger.error("Number of message chunks: %s is > configured max chunk count: %s", sz, self.max_chunk_count)
return within_limit

def create_acknowledge_and_set_limits(self, msg: ua.Hello) -> ua.Acknowledge:
def create_acknowledge_and_set_limits(self, msg: "ua.Hello") -> "ua.Acknowledge":
Copy link
Member

Choose a reason for hiding this comment

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

that too cannot be correct. should be possible to use from __future__ import annotations stuff to avoid adding "

Copy link
Member

Choose a reason for hiding this comment

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

there should be no reason to use " for typing

@oroulet
Copy link
Member

oroulet commented Oct 17, 2024

@jbeckerwsi conflicts and some comments

1 similar comment
@oroulet
Copy link
Member

oroulet commented Dec 4, 2024

@jbeckerwsi conflicts and some comments

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