[issue21723] Float maxsize is treated as infinity in asyncio.Queue

Vajrasky Kok report at bugs.python.org
Wed Jun 11 17:59:55 CEST 2014


New submission from Vajrasky Kok:

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.

----------
components: asyncio
files: asyncio_queue_accept_handles_maxsize.patch
keywords: patch
messages: 220280
nosy: gvanrossum, haypo, vajrasky, yselivanov
priority: normal
severity: normal
status: open
title: Float maxsize is treated as infinity in asyncio.Queue
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file35574/asyncio_queue_accept_handles_maxsize.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21723>
_______________________________________


More information about the Python-bugs-list mailing list