Python: list structural implementers of typing.Protocol in the lego / implementors view
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Start by locating the Python handling for --for and the lego implementors view, then read how nominal implementors are identified and how Python classes and typing.Protocol methods are represented. Check the existing tests for those views before deciding where structural matches should appear. Done means qualifying classes that cover a Protocol’s public methods can be shown as structural implementors, distinguishable from nominal subclasses, with tests covering the behavior and its limits.
Written by the indexing model from the issue text.
Description
In Python, a class usually satisfies a typing.Protocol structurally: it defines the protocol's methods without subclassing it. --for and the lego block list only nominal implementors.
On a medium Python codebase we measured, a provider Protocol shows 5 implementors in the lego view, all of them sub-protocols, while 17 concrete classes define every one of its methods. The same holds for most protocols in that tree: 35 of 38 Protocol/ABC bases have implementers, but only 5 have nominal ones.
Request: for Python, optionally include classes whose public methods cover a Protocol's public methods, marked as structural so they are distinguishable from nominal subclasses. A minimum-method threshold or a confidence mark would keep single-method protocols from matching too broadly.
Why it matters for agent context: "what already implements this interface?" is the question an agent asks before writing a new adapter, and today the answer for Protocols is empty.
Observed on ripwire 0.6.1; the 0.6.2 to 0.6.5 release notes do not mention structural Protocol implementers.
- Dominant language
- C++
- Stars
- 2.5k
- Forks
- 158
- Avg merge
- 2d 50m
- Merged PRs (30d)
- 55
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
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 redhat-et/ripwire
-
Difficulty 2/5 Under an hour Newbie friendliness 78/100
redhat-et/ripwire#334 · 7 comments ·
Maintainers usually reply within 1 day
-
help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
redhat-et/ripwire#68 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
enhancement help wanted
Difficulty 5/5 Over a week Newbie friendliness 25/100
Maintainers usually reply within 1 day
-
enhancement help wanted
Difficulty 4/5 3-5 days Newbie friendliness 53/100
Maintainers usually reply within 1 day
All issues in redhat-et/ripwire
Similar issues
-
Status: Needs confirmation Status: Needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
boykopovar/AnyPS5#12124 ·
Maintainers usually reply within 1 day
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
A-combat P-low S-ready-to-start task
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day