Refactor argument handling to enforce positional-only and keyword-only arguments using /
and *
#834
Labels
good first issue
Good for newcomers
type: design 📐
Relevant to code architecture
type: enhancement ✨
Features or aspects to improve
Milestone
What should we add?
Description
To improve readability and usability in the Qiskit codebase, we propose refactoring function signatures to clearly define positional-only, positional-or-keyword, and keyword-only arguments using the
/
and*
symbols. Parameters before the slash will be strictly positional, while those after the asterisk will be keyword-only. This approach clarifies the API and aligns with Python standards, as in Scikit-learn.We can start with function signatures and see which arguments should be made keyword-only or remain positional. Temporary lint disables may be necessary to prevent errors during the transition, as seen in #833.
Example from Pegasos QSVC
into
The text was updated successfully, but these errors were encountered: