| unused=False, | ||
| c_default: str | None = None, | ||
| py_default: str | None = None, | ||
| annotation: str | Unspecified = unspecified, |
There was a problem hiding this comment.
Doesn't need to be done now (and you may not like the suggestion), but you could use an enum for all the sentinels that are defined in clinic.py, instead of defining three separate classes (Unspecified, Null and Unknown):
If you did that, then you'd be able to use a typing.Literal annotation here, which would be more expressive of the fact that unspecified is a singleton:
| annotation: str | Unspecified = unspecified, | |
| annotation: str | Literal[Sentinels.unspecified] = unspecified, |
Sorry, something went wrong.
There was a problem hiding this comment.
Neat!
Sorry, something went wrong.
| data.cleanup.append('/* Cleanup for ' + name + ' */\n' + cleanup.rstrip() + "\n") | ||
|
|
||
| def render(self, parameter, data): | ||
| def render(self, parameter: str, data: CRenderData) -> None: |
There was a problem hiding this comment.
This looks fishy. parameter should be a Parameter instance, but also str is accepted. Let's look into that in a follow-up PR.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.