[UNTESTED] Add support for renaming to kebap-case - #175
Conversation
jcrist
left a comment
There was a problem hiding this comment.
Thanks for the PR! This mostly looks good to me, I can finish up the few final tweaks needed.
I didn't test the code due to me virtually never working with Python and less with its C API, so it'd be good if someone else tested it.
Out of curiosity - if you never work with Python and didn't test this feature locally, is this a feature you needed yourself? Or just something you noticed was missing?
| tag_field: Union[None, str] = None, | ||
| rename: Union[ | ||
| None, Literal["lower", "upper", "camel", "pascal"], Callable[[str], str] | ||
| None, Literal["lower", "upper", "kebap", "camel", "pascal"], Callable[[str], str] |
There was a problem hiding this comment.
TIL some people spell this "kebap" instead of "kebab". Since other tools like serde use the "kebab" spelling (https://serde.rs/container-attrs.html#rename_all), I think we should go with that one.
There was a problem hiding this comment.
Ah, it seems like kebap is a bit more common in Germany as this is the spelling I see at my local Döner Kebap :-)
But I have absolutely nothing against naming it kebab, especially if this is more common
Great! Thanks for your work on maintaining this piece of software!
I simply helped out a colleague who was struggling to find the right place in the API and defined them a simple |
|
Thanks! |
Hi,
this should implement builtin renaming to kebap-case. I didn't test the code due to me virtually never working with Python and less with its C API, so it'd be good if someone else tested it. Also, I only added one test case where I saw fit/understood the testing harness, more could be added but I wouldn't know how.