Movatterモバイル変換


[0]ホーム

URL:


[Python-Dev] partition() (was: Remove str.find in 3.0?)

Nick Coghlanncoghlan at gmail.com
Tue Aug 30 14:49:48 CEST 2005


Delaney, Timothy (Tim) wrote:> Of course, if I (or someone else) can't come up with an obviously better> name, partition() will win by default. I don't think it's a *bad* name -> just don't think it's a particularly *obvious* name.What about simply "str.parts" and "str.rparts"? That is, rather than splitting the string on a separator, we are breaking it into parts - the part before the separator, the separator itself, and the part after the separator. Same concept as 'partition', just a shorter method name.Another option would be simply "str.part()" and "str.rpart()". Then you could think of it as an abbreviation of either 'partition' or 'parts' depending on your inclination.> I think that one of the things I have against it is that most times I> type it, I get a typo. If this function is accepted, I think it will> (and should!) become one of the most used string functions around. As> such, the name should be *very* easy to type.I've been typing 'partition' a lot lately at work, and Tim's right - typing this correctly is harder than you might think. It is very easy to only type the 'ti' in the middle once, so that you end up with 'partion'.Cheers,Nick.-- Nick Coghlan   |ncoghlan at gmail.com   |   Brisbane, Australia---------------------------------------------------------------http://boredomandlaziness.blogspot.com


More information about the Python-Devmailing list

[8]ページ先頭

©2009-2025 Movatter.jp