python-trio / python-trio/unasync
Multitoken substitution
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 108
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
Description
Hey 👋
I recently came across unasync and wanted to commend you on this incredibly promising & useful project.
In that vein, I wanted to note that certain substitutions (notably additional_replacements={"@pytest.mark.trio": ""}) effectively results in a no-op as a result of the tokenization converting @pytest.mark.trio to the tokens @pytest, mark and trio.
Although token-based execution is theoretically superior, it adds a layer of complexity that httpcore's unasync.py doesn't face.
My recommendation would be to also tokenize the additional_replacements and attempt to match the token streams.
Happy to implement it once we're aligned on a solution.
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 by locating the tokenization and additional_replacements handling in the repository, then compare the linked httpcore unasync.py implementation. Check how @pytest.mark.trio is split into tokens and determine how replacement token streams should be matched. Done means the stated replacement no longer becomes a no-op and the relevant tests cover multitoken substitutions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100