lidatong / dataclasses-json

Easily serialize Data Classes to and from JSON
MIT License
1.34k stars 150 forks source link

Fix snakecase converter for multi-numeric strings #517

Closed jespBE closed 4 months ago

jespBE commented 4 months ago

Resolves #516

Change to the SnakeCase letter converter to give more consistent behavior for strings containing multiple numeric characters in sequence. For instance:

print(old_snakecase('Alice'), new_snakecase('Alice')) alice alice

print(old_snakecase('Alice123'), new_snakecase('Alice123')) alice_1_2_3 alice123

print(old_snakecase('AliceBob123'), new_snakecase('AliceBob123')) alice_bob_1_2_3 alice_bob123

jespBE commented 4 months ago

Closing because uploaded on wrong Github account, oops!