Martin Teichmann <martin.teichm...@gmail.com> added the comment:

Hi Andrew,

I still don't get your point. First, this is an extension to the asyncio 
library, so concurrency is not an issue. And sure, if you call random methods 
of an object without any reason the outcome won't be anything useful, why, in 
your example, should the one task call close at all?

There is, however, a strong use case: If you have many producers but just one 
consumer and the consumer stops consuming, it should cancel all producers 
waiting on the queue. The same way, if you have one producer but many 
consumers, once the single producer stops producing, it should cancel all 
waiting consumers. In these situations, the outcome is very clear.

Whether it should be possible to "resurrect" a closed/cancelled queue I don't 
care much, as I neither see a use case in doing so nor a compelling argument 
why it should be artificially prohibited. So I simply went for the most simple 
code.

The proposed code does something very simple, something a user can grasp. That 
is IMHO a better protection for users than some code trying to artificially 
stop users from harming themselves.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue37334>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to