Repeated capability accessors return internal `_SessionBase` type
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 128
- Forks
- 110
- Avg merge
- 5d 14h
- Merged PRs (30d)
- 10
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.
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.
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.
Assessment
- Tech stack
- python
- Domain
- backend-api-design
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100