-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
gh-113317: Add libclinic.converter and libclinic.crenderdata modules #116821
Conversation
vstinner
commented
Mar 14, 2024
•
edited by bedevere-app
bot
Loading
edited by bedevere-app
bot
- Move CConverter class to a new libclinic.converter module.
- Move CRenderData and Include classes to a new libclinic.crenderdata module.
- Issue: Argument Clinic: split out global stateless helpers and constants from clinic.py #113317
* Move CConverter class to a new libclinic.converter module. * Move CRenderData and Include classes to a new libclinic.crenderdata module.
# maps strings to callables. | ||
# these callables must be of the form: | ||
# def foo(name, default, *, ...) | ||
# The callable may have any number of keyword-only parameters. | ||
# The callable must return a CConverter object. | ||
# The callable should not call builtins.print. | ||
converters: ConverterDict = {} | ||
|
||
# maps strings to callables. | ||
# these callables follow the same rules as those for "converters" above. | ||
# note however that they will never be called with keyword-only parameters. | ||
legacy_converters: ConverterDict = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These belong to the Argument Clinic app (or CLI if you will), so IMO they should not be part of the Argument Clinic library. IMO, it is part of the Argument Clinic app config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to move as much code as possible inside libclinic, including the CLI and "app" logic. Apparently, we have a disagreement on that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not oppose to move the CLI / app into libclinic. What I'm saying is I think the global converters
and legacy_converters
dicts should be a part of the CLI config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, that makes sense. The practical issue is to reorganize code (move code around) when they are inter-dependenies and most code is left in clinic.py
. Code from libclinic/ cannot get code from clinic.py
. Once more code will be moved to libclinic, it will be easier to group related code.
* Move CConverter class to a new libclinic.converter module. * Move CRenderData and Include classes to a new libclinic.crenderdata module.
* Move CConverter class to a new libclinic.converter module. * Move CRenderData and Include classes to a new libclinic.crenderdata module.
* Move CConverter class to a new libclinic.converter module. * Move CRenderData and Include classes to a new libclinic.crenderdata module.