Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Acronyms with inner digits do not decamelize correctly #258

Closed
lorrin opened this issue Apr 6, 2022 · 0 comments · Fixed by #274
Closed

Acronyms with inner digits do not decamelize correctly #258

lorrin opened this issue Apr 6, 2022 · 0 comments · Fixed by #274

Comments

@lorrin
Copy link

lorrin commented 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

>>> 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)

@lorrin lorrin changed the title Acronyms with digits do not decamelize correctly Acronyms with inner digits do not decamelize correctly Apr 6, 2022
@SeaSkyThe SeaSkyThe mentioned this issue Aug 3, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant