[issue40437] add string.snake function

2020-04-30 Thread Eric V. Smith
Eric V. Smith added the comment: Thanks for the suggestion and the discussion. I'll close the issue. -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker

[issue40437] add string.snake function

2020-04-30 Thread jeffolsi10
jeffolsi10 added the comment: I can respect that. So you may close this request. -- ___ Python tracker ___ ___ Python-bugs-list mai

[issue40437] add string.snake function

2020-04-29 Thread Eric V. Smith
Eric V. Smith added the comment: > One can also argue why python need to maintain str conversion at all if we > have such good extensions in different libs. Back when we were starting python 3.x there was discussion or removing these from str and bytes, but it was decided that breaking exist

[issue40437] add string.snake function

2020-04-29 Thread jeffolsi10
jeffolsi10 added the comment: Rémi Lapeyre not all of them. I can give list of many examples where snake case is needed. But the question is: Are we discussing if snake case is even needed or are we discussing if this should be in python core. Those are two totally different things. 1. The n

[issue40437] add string.snake function

2020-04-29 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: I don't understand the motivation, why would it be very useful when working with titles of columns that are to be used in databases columns? Databases can handle columns with spaces in their name: postgres=# create temporary table foo ("column with spaces" text

[issue40437] add string.snake function

2020-04-29 Thread jeffolsi10
jeffolsi10 added the comment: I feel this should be in core. I still don't understand why capitalize is supported and others do not. snake case is very well defined. Issues like tabs and spaces are not relevant. can you show example that you have that dilemma? To be honest I don't feel very s

[issue40437] add string.snake function

2020-04-29 Thread Eric V. Smith
Eric V. Smith added the comment: I remain unconvinced, but I'm only one person. You might want to bring this up on python-ideas to see if it can get some more support. But be aware this is going to have much less support that the recent PEP 616 removeprefix/removesuffix discussion, which wen

[issue40437] add string.snake function

2020-04-29 Thread jeffolsi10
jeffolsi10 added the comment: it can. This is why I'm asking this. Consider APIs that return list of names in camelCase. You must convert the keys to snakeCase to create tables from it as it's bad practice to have capitalised letters in columns or table names. Further more, consider someone

[issue40437] add string.snake function

2020-04-29 Thread Eric V. Smith
Eric V. Smith added the comment: So then it appears the snake case function couldn't be used for database column names, without some additional processing. So, what is the use case for it? I just don't see a lot of use for this. -- ___ Python trac

[issue40437] add string.snake function

2020-04-29 Thread jeffolsi10
jeffolsi10 added the comment: I'd like also to point that there are few other cases: https://stackoverflow.com/questions/11273282/whats-the-name-for-hyphen-separated-case This is PascalCase: SomeSymbol This is camelCase: someSymbol This is snake_case: some_symbol So a possible function could

[issue40437] add string.snake function

2020-04-29 Thread jeffolsi10
jeffolsi10 added the comment: snake case has very specific definition : https://en.wikipedia.org/wiki/Snake_case I expect the function to implement the definition and not something that I or someone else desire. As for your question about '$' char I could ask the same thing for lower() The sn

[issue40437] add string.snake function

2020-04-29 Thread Eric V. Smith
Eric V. Smith added the comment: What would be the full specification of this? If you want to use it for column names, what happens if the string starts with a $, or some character that can't be used by your particular database? I'm skeptical that this could be general purpose enough to be u

[issue40437] add string.snake function

2020-04-29 Thread jeffolsi10
New submission from jeffolsi10 : Like we have: capitalize swapcase and others we should also have snake case Which converts: before: First Name, Last Name, Employee Status, Subject after: first_name, last_name, employee_status, subject This is very useful when working with titles of columns th