-
Notifications
You must be signed in to change notification settings - Fork 345
Refactor argument handling to enforce positional-only and keyword-only arguments using /
and *
#834
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @edoaltamura. Does this issue still exists ? If yes, I'd like to assign it to myself and contribute. Please let me know. |
Hi @tsmanral, it does! Thanks for your interest in this project. You're very welcome to scan the code for definitions that need an update. I'd like to make two suggestions:
|
Also related to linting, this old issue #159 might be tackled with a similar approach. Numpy typing has become more stable since the issue was first opened, see https://numpy.org/doc/stable/reference/typing.html |
Thank you @edoaltamura. I'll review this first to identify the changes, then I'll create a PR from my fork to the main repository. |
How is this task progressing, @tsmanral? Is there anything my team and I can help with? Could you share the link to a public branch where you are making the code changes? |
Hi, can i work on this? |
Hi @uuu4, sure you can! Thanks for your interest, and looking forward to your contribution. |
Thank you for assigning me! I submitted my PR and, after removing the related |
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: