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

decamelize incorrectly inserts _ after punctuation #257

Open
lorrin opened this issue Apr 6, 2022 · 2 comments
Open

decamelize incorrectly inserts _ after punctuation #257

lorrin opened this issue Apr 6, 2022 · 2 comments

Comments

@lorrin
Copy link

lorrin commented Apr 6, 2022

If lower and upper case characters are separated by punctuation, decamelize should not insert an underscore as well.

To Reproduce

>>> for c in '.,<>/?;:\'"[]{}\\|`~!@#$%^&*()-_=+':
...   print(f"humps.decamelize(foo{c}Bar): " + humps.decamelize(f"foo{c}Bar"))
...
humps.decamelize(foo.Bar): foo._bar
humps.decamelize(foo,Bar): foo,_bar
humps.decamelize(foo<Bar): foo<_bar
humps.decamelize(foo>Bar): foo>_bar
humps.decamelize(foo/Bar): foo/_bar
humps.decamelize(foo?Bar): foo?_bar
humps.decamelize(foo;Bar): foo;_bar
humps.decamelize(foo:Bar): foo:_bar
humps.decamelize(foo'Bar): foo'_bar
humps.decamelize(foo"Bar): foo"_bar
humps.decamelize(foo[Bar): foo[_bar
humps.decamelize(foo]Bar): foo]_bar
humps.decamelize(foo{Bar): foo{_bar
humps.decamelize(foo}Bar): foo}_bar
humps.decamelize(foo\Bar): foo\_bar
humps.decamelize(foo|Bar): foo|_bar
humps.decamelize(foo`Bar): foo`_bar
humps.decamelize(foo~Bar): foo~_bar
humps.decamelize(foo!Bar): foo!_bar
humps.decamelize(foo@Bar): foo@_bar
humps.decamelize(foo#Bar): foo#_bar
humps.decamelize(foo$Bar): foo$_bar
humps.decamelize(foo%Bar): foo%_bar
humps.decamelize(foo^Bar): foo^_bar
humps.decamelize(foo&Bar): foo&_bar
humps.decamelize(foo*Bar): foo*_bar
humps.decamelize(foo(Bar): foo(_bar
humps.decamelize(foo)Bar): foo)_bar
humps.decamelize(foo-Bar): foo_-bar
humps.decamelize(foo_Bar): foo__bar
humps.decamelize(foo=Bar): foo=_bar
humps.decamelize(foo+Bar): foo+_bar

Expected behavior
No underscore should have been inserted.

Additional context
pyhumps-3.5.3 on Python 3.10.2 on macOS 12.3.1 (21E258)

@ificiana
Copy link
Contributor

Not sure if pyhumps is supposed to handle these cases

@nficano
Copy link
Owner

nficano commented Aug 26, 2022

+1

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

No branches or pull requests

3 participants