MagicStack / MagicStack/uvloop
Loop.call_later(0) and Loop.call_later(-1) return a uvloop.loop.Handle and not an asyncio.TimerHandle
Open
Nobody has claimed this yet.
- Dominant language
- Cython
- Stars
- 11.9k
- Forks
- 616
- PR merge metrics
- No merged PRs in 30d
Description
- uvloop version: master
- Python version: 3.10
- Platform: ubuntu
- Can you reproduce the bug with
PYTHONASYNCIODEBUGin env?: yes - Does uvloop behave differently from vanilla asyncio? How?: yes
Python 3.10.5 (main, Jun 11 2022, 16:53:24) [GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import asyncio
>>> import uvloop
>>> uvloop.new_event_loop().call_later(-1, lambda: None)
<Handle <lambda>>
>>> asyncio.new_event_loop().call_later(-1, lambda: None)
<TimerHandle when=79332.145640902 <lambda>() at <stdin>:1>
>>>
the bug is here:
https://github.com/MagicStack/uvloop/blob/5926386f81ea49903db9d5095058787ed91cff3d/uvloop/loop.pyx#L1327-L1328
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in uvloop/loop.pyx at lines 1327-1328 and compare the behavior of Loop.call_later(0) and Loop.call_later(-1) with vanilla asyncio. Done means both uvloop calls return an asyncio.TimerHandle rather than a uvloop.loop.Handle, including when PYTHONASYNCIODEBUG is enabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100