-
|
I believe this is related to #1079 but my use-case is slightly different. I have a decorator which adds support for arbitrary kwargs to an existing method — e.g. I know that |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Not much has changed recently. You can override a method and keep the type unchanged (my A couple alternatives:
|
Beta Was this translation helpful? Give feedback.
Not much has changed recently. You can override a method and keep the type unchanged (my
@copy_typedecorator). You can add positional arguments withConcatenate, although I don't think it's fully implemented in mypy. But as you say, there isn't anything for adding keyword arguments.A couple alternatives:
If you have a lot of code calling your custom logger methods, you can copy/paste the definitions of
debug(),info()etc into your custom logger class, maybe withif TYPE_CHECKING.Just take
**kwargs: Anyin your custom methods, e.g.