You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is that cloup.HelpTheme is a NamedTuple. And I cannot easily sub-class it. As you can see in my code, I had to redefine the whole properties and methods.
@janluke, would you be open to change the type of HelpTheme so I can reuse it seamlessly?
I naively think that a class is the natural choice, but maybe a @dataclass might be another alternative to NamedTuple. I'm pretty sure you have a better idea of what HelpTheme should look like in that case.
The text was updated successfully, but these errors were encountered:
In Click Extra, I have a default theme lying around that try to extends
cloup.HelpTheme
with additional categories of styles. Like log-level colors and other help screen details.The problem is that
cloup.HelpTheme
is aNamedTuple
. And I cannot easily sub-class it. As you can see in my code, I had to redefine the whole properties and methods.I also encountered issues with MyPy which cannot solve references to sub-styles:
That is somewhat expected, as
NamedTuple
subclasses is flagged aswontfix
by Python'styping
project.@janluke, would you be open to change the type of
HelpTheme
so I can reuse it seamlessly?I naively think that a class is the natural choice, but maybe a
@dataclass
might be another alternative toNamedTuple
. I'm pretty sure you have a better idea of whatHelpTheme
should look like in that case.The text was updated successfully, but these errors were encountered: