Repeated capability accessors return internal `_SessionBase` type
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- backend-api-design
Research direction
Start by locating the implementations and type annotations for repeated capability accessors such as Session.channels and Session.instruments, then compare them with the usage in examples/output_voltage_measurement/measurement.py around line 177. Done means clients can use a public type for channel objects in PEP 484 annotations instead of referring to the internal _SessionBase type.
Written by the indexing model from the issue text.
Description
Description of issue
Repeated capability accessors like Session.channels and Session.instruments return a _SessionBase object. Clients that pass channel objects around may need to refer to this type in PEP 484 type hints.
def _wait_for_source_complete_event(
measurement_service: nims.MeasurementService,
channels: nidcpower._SessionBase,
cancellation_event: threading.Event,
) -> None: ...
The convention recommended in PEP8 and used by most Python code is that names with a single leading underscore are for internal use.
In general, public APIs ought to use public types.
System report
Not applicable.
Steps to reproduce issue
- Write a function that accepts a channel object (such as the linked example).
- Write PEP 484 type hints for this function.
- Dominant language
- Python
- Stars
- 128
- Forks
- 110
- Avg merge
- 5d 14h
- Merged PRs (30d)
- 10
Contributor 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 ni/nimi-python
-
docs nitclk priority-low
Difficulty 1/5 Under an hour Newbie friendliness 68/100
ni/nimi-python#1993 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
ni/nimi-python#2164 · 1 comment ·
-
bug docs
Difficulty 1/5 Under an hour Newbie friendliness 48/100
ni/nimi-python#2162 ·
-
codegen enhancement
Difficulty 4/5 3-5 days Newbie friendliness 42/100
ni/nimi-python#2148 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
ni/nimi-python#2122 ·
Similar issues
-
area: harness bug status: needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Human-Agent-Society/reef#625 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 1/5 Under an hour Newbie friendliness 80/100
learningequality/kolibri#15351 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Name consistency Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
eellak/triplestore#65 · 1 comment ·