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

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

astitcher commented on issue #188: PROTON-2091: fix `len(queue)` in 
python/examples and reformat for PEP8
URL: https://github.com/apache/qpid-proton/pull/188#issuecomment-524469383
 
 
   I think you left extraneous testing code in the bottom of the file.
   Otherwise looks good to me.
 
----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> [python] example broker never removes empty queues
> --------------------------------------------------
>
>                 Key: PROTON-2091
>                 URL: https://issues.apache.org/jira/browse/PROTON-2091
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: python-binding
>    Affects Versions: proton-c-0.29.0
>            Reporter: Jiri Daněk
>            Priority: Trivial
>
> {code:python:title=python/examples/broker.py}
>     def unsubscribe(self, consumer):
>          if consumer in self.consumers:
>             self.consumers.remove(consumer)
>          return len(self.consumers) == 0 and (self.dynamic or 
> self.queue.count == 0)
> {code}
> Here, {{self.queue.count == 0}} can never be {{True}} (because method 
> reference != integer). This means that broker will never drop the {{Queue}} 
> object.
> Functionality wise, the impact of this is insignificant, given the uses of 
> the code (stand-in for real broker when running simple messaging examples).
> It has compatibility implications, however, because {{self.queue.count}} is a 
> Python 2.7 addition and on Python 2.6 accessing undefined property will raise 
> exception and crash the broker.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

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

Reply via email to