Open mgoodhand opened 7 years ago
@mgoodhand the current docs are showing correctly.
stringcase.alphanumcase('_Foo., Bar') # =>'FooBar'
Yes, the docs for alphanumcase
are correct, but the implementation seems wrong:
(env) eden:tmp mrg$ pip install stringcase
Collecting stringcase
Installing collected packages: stringcase
Successfully installed stringcase-1.2.0
You are using pip version 19.0.3, however version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(env) eden:tmp mrg$ python
Python 3.7.4 (default, Jul 9 2019, 18:13:23)
[Clang 10.0.1 (clang-1001.0.46.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import stringcase
>>> stringcase.alphanumcase('_Foo., Bar') # =>'FooBar'
'_FooBar'
>>> stringcase.alphanumcase('Foo_123 Bar!')
'Foo_123Bar'
For the other ones mentioned, it's the documentation that's wrong, e.g.
>>> stringcase.constcase('FooBarBaz') # => "_FOO_BAR_BAZ"
'FOO_BAR_BAZ'
The implementation matches what I'd expect (FOO_BAR_BAZ
), but the documentation includes a leading underscore (_FOO_BAR_BAZ
).
The documentation in the README and on pypi is out of sync with the implementation (1.2.0):
For all except the last one, I think the code is doing the right thing and the docs are wrong.
I presume alphanumcase is meant to drop all non-alphanumeric characters, so the fact that it currently retains '_' seems problematic.