Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CamelCase Conversions
#4
(Apr-18-2019, 10:01 AM)snippsat Wrote:
λ ptpython
# Fail on this
>>> snakecase('getHTTPResponseCode')
'get_h_t_t_p_response_code'

It's surprising as with groupby it gives expected result:

>>> pepify('getHTTPResponseCode')
'get_httpresponse_code'
However, for keeping leading underscore it must be adjusted:

>>> pepify('_getHTTPResponseCode')
'get_httpresponse_code'
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Messages In This Thread
CamelCase Conversions - by Skaperen - Apr-18-2019, 12:57 AM
RE: CamelCase Conversions - by perfringo - Apr-18-2019, 07:58 AM
RE: CamelCase Conversions - by snippsat - Apr-18-2019, 10:01 AM
RE: CamelCase Conversions - by perfringo - Apr-18-2019, 10:12 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020