You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by GitBox <gi...@apache.org> on 2021/08/14 17:00:57 UTC

[GitHub] [qpid-proton] jiridanek commented on a change in pull request #332: PROTON-2407 [python] fix type-related documentation

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: dev-unsubscribe@qpid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org