[ 
https://issues.apache.org/jira/browse/PROTON-2407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17399216#comment-17399216
 ] 

ASF GitHub Bot commented on PROTON-2407:
----------------------------------------

jiridanek commented on a change in pull request #332:
URL: https://github.com/apache/qpid-proton/pull/332#discussion_r688969245



##########
File path: python/proton/_handlers.py
##########
@@ -322,74 +322,64 @@ def __init__(self, peer_close_is_error: bool = False, 
delegate: Optional[Handler
         self.peer_close_is_error = peer_close_is_error
 
     @classmethod
-    def is_local_open(cls, endpoint):
+    def is_local_open(cls, endpoint: Endpoint) -> bool:
         """
         Test if local ``endpoint`` is open (ie has state
         :const:`proton.Endpoint.LOCAL_ACTIVE`).
 
         :param endpoint: The local endpoint to be tested.
-        :type endpoint: Any child of :class:`proton.Endpoint`
         :return: ``True`` if local endpoint is in state
             :const:`proton.Endpoint.LOCAL_ACTIVE`, ``False`` otherwise.
-        :rtype: ``bool``
         """
-        return endpoint.state & Endpoint.LOCAL_ACTIVE
+        return bool(endpoint.state & Endpoint.LOCAL_ACTIVE)

Review comment:
       The return type used to be `int`; I think in this instance it makes 
sense to adjust the code to match the docs, rather than the other way around.




-- 
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]


> [proton-python] add type annotations
> ------------------------------------
>
>                 Key: PROTON-2407
>                 URL: https://issues.apache.org/jira/browse/PROTON-2407
>             Project: Qpid Proton
>          Issue Type: New Feature
>          Components: python-binding
>    Affects Versions: proton-c-0.35.0
>            Reporter: Jiri Daněk
>            Assignee: Jiri Daněk
>            Priority: Major
>             Fix For: proton-c-0.36.0
>
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to