Guido van Rossum added the comment:
The patch looks fine to me.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21723
___
___
Python-bugs-list
Roundup Robot added the comment:
New changeset ccfc13183fea by Victor Stinner in branch '3.4':
Issue #21723: asyncio.Queue: support any type of number (ex: float) for the
http://hg.python.org/cpython/rev/ccfc13183fea
New changeset a2f115bfa513 by Victor Stinner in branch 'default':
(Merge 3.4)
STINNER Victor added the comment:
Change also pushed to Tulip (changeset 3a392e5328c0).
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21723
___
STINNER Victor added the comment:
Thanks Vajrasky, I aplied your patch.
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21723
___
Changes by A. Jesse Jiryu Davis je...@emptysquare.net:
--
nosy: +emptysquare
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21723
___
___
Vajrasky Kok added the comment:
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?
--
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
STINNER Victor added the comment:
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.
--
___
Python tracker rep...@bugs.python.org
Yury Selivanov added the comment:
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.
--
___
Python