gh-113317: Add libclinic.converter and libclinic.crenderdata modules#116821
gh-113317: Add libclinic.converter and libclinic.crenderdata modules#116821vstinner merged 1 commit intopython:mainfrom
Conversation
* 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.
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.
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.
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.
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.
Uh oh!
There was an error while loading. Please reload this page.