Commit a0a70e3
committed
Make
This commit changes the signature of
`redbot.core.i18n.Translator.__call__()` from `self, untranslated: str`
to `self, untranslated: str, /`, making `untranslated` a positional-only
argument.
This works around an issue in `redgettext`, where using `_("text")`
works fine, but `_(untranslated="text")` causes `untranslated=` to be
detected as an unexpected token. Considering this function is a
single-argument function, and nothing would be gained from using the
keyword argument, I believe marking it as positional-only is the correct
solution, rather than making a change in `redgettext`. This is
technically a breaking change though.
This also has the small but notable side effect of removing
`untranslated=` from calls in editors that show inline keyword
arguments, such as basedpyright's
`basedpyright.analysis.inlayHints.callArgumentNames` VSCode setting, or
similar settings in other extensions. This cuts down on wasted space in
the editor without disabling an otherwise useful feature.
See the related discussion in
[`#coding`](https://discord.com/channels/133049272517001216/160386989819035648/1453030635756191866).untranslated a positional-only argument in Translator().1 parent dd3b9a0 commit a0a70e3
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
282 | | - | |
| 282 | + | |
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
| |||
0 commit comments