import asyncio loop = asyncio.get_event_loop() q = asyncio.Queue(maxsize=1.2, loop=loop) q.put_nowait(1) q.put_nowait(1) q.put_nowait(1) q.put_nowait(1) q.put_nowait(1) .... and so on It seems counter intuitive for my innocent eyes. As comparison with the traditional queue: import queue q = queue.Queue(maxsize=1.2) q.put(1) q.put(1) q.put(1) -> blocking Here is the patch to make the behaviour consistent with its sibling.
It looks strange to use a float as maxsize. I suggest to raise a TypeError in the constructor if the type is not int, or maybe to cast maxsize parameter to an int.
FWIW, this can also be resolved by fixing Queue.full to do "self.qsize() >= self._maxsize" instead of "self.qsize() == self._maxsize". I generally don't like implicit casts as they break duck typing.
"It looks strange to use a float as maxsize." => It is. But the float could be coming programmatically. Float value interpreted as infinity could give a shock for some people. "maybe to cast maxsize parameter to an int." => ceiling or flooring?