Skip to content

Add _waiters type hints to asyncio.locks #11314

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Olegt0rr opened this issue Jan 25, 2024 · 0 comments · Fixed by #11315
Closed

Add _waiters type hints to asyncio.locks #11314

Olegt0rr opened this issue Jan 25, 2024 · 0 comments · Fixed by #11315
Labels
topic: asyncio Asyncio-related issues

Comments

@Olegt0rr
Copy link
Contributor

Olegt0rr commented Jan 25, 2024

There's no public vars can be used to check Lock has waiters or not...
But it has _waiters

But my editor, used typedshed and says: Unresolved attribute reference '_waiters' for class 'Lock'
Screenshot 2024-01-25 at 16 44 31

Also Semaphore already has _waiters type hint...

class Semaphore(_ContextManagerMixin, _LoopBoundMixin):
_value: int
_waiters: deque[Future[Any]]

But it has wrong type. It should be Optional, cause it's None on init:
Screenshot 2024-01-25 at 16 55 37

@AlexWaygood AlexWaygood added the topic: asyncio Asyncio-related issues label Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: asyncio Asyncio-related issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants