Typing annotations not working as intented
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Compare the backport's ContextVar behavior with Python's built-in contextvars using the generic annotation example from the issue. Add regression coverage for ContextVar[str] annotations and verify that the Celery-related usage works as expected; done means the backport accepts the same annotation form.
Written by the indexing model from the issue text.
Description
Hi! I've found a difference between the built-in version of contextvars and this backport.
Generic type annotations are not supported. This works in python:
c: contextvars.ContextVar[str] = contextvars.ContextVar('test')
but not in this backport. It caused a pretty surprising issue with celery https://github.com/celery/celery/issues/6534
Would it be possible to fix it?
- Dominant language
- Python
- Stars
- 90
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
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.
More from MagicStack/contextvars
-
Difficulty 4/5 3-5 days Newbie friendliness 20/100
MagicStack/contextvars#18 · 1 comment · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
MagicStack/contextvars#17 · 1 reaction ·
-
2.4: pytest warning Open
Difficulty 1/5 Under an hour Newbie friendliness 35/100
MagicStack/contextvars#16 ·
-
asyncio support Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
MagicStack/contextvars#2 · 16 comments ·
All issues in MagicStack/contextvars
Similar issues
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
simonw/sqlite-utils#872 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100