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
decamelize treats a sequence of upper case characters followed by lowercase characters as two words, one being all but the last upper case character (presumably an acronym), the rest being the second word. humps.decamelize('AWSThing') yields 'aws_thing'. Acronyms may end in digits as well: humps.decamelize('B52Thing') yields 'b52_thing'. This logic is not correctly applied when the acronym contains inner digits.
To Reproduce
>>> humps.decamelize('B2BThing')
'b2_b_thing'
Expected behavior
All upper case characters and digits except the last one should be treated as a single word, yielding b2b_thing.
Additional context
pyhumps-3.5.3 on Python 3.10.2 on macOS 12.3.1 (21E258)
The text was updated successfully, but these errors were encountered:
lorrin
changed the title
Acronyms with digits do not decamelize correctly
Acronyms with inner digits do not decamelize correctly
Apr 6, 2022
decamelize
treats a sequence of upper case characters followed by lowercase characters as two words, one being all but the last upper case character (presumably an acronym), the rest being the second word.humps.decamelize('AWSThing')
yields'aws_thing'
. Acronyms may end in digits as well:humps.decamelize('B52Thing')
yields'b52_thing'
. This logic is not correctly applied when the acronym contains inner digits.To Reproduce
Expected behavior
All upper case characters and digits except the last one should be treated as a single word, yielding
b2b_thing
.Additional context
pyhumps-3.5.3 on Python 3.10.2 on macOS 12.3.1 (21E258)
The text was updated successfully, but these errors were encountered: