Nick Coghlan wrote: > Ron Adam wrote: > >>I don't feel there is a need to avoid numbers entirely. In this case I >>think it's the better way to find the n'th seperator and since it's an >>optional value I feel it doesn't add a lot of complication. Anyway... >>It's just a suggestion. > > > Avoid overengineering this without genuine use cases. Raymond's review of the > standard library shows that the basic version of str.partition provides > definite readability benefits and also makes it easier to write correct code - > enhancements can wait until we have some real experience with how people use > the method. > > Cheers, > Nick. The use cases for nth items 1 and -1 are the same ones for partition() and rpartition. It's only values greater or less than those that need use cases. (I'll try to find some.) True, a directional index enhancement could be added later, but not considering it now and then adding it later would mean rpartition() would become redundant and/or an argument against doing it later. As it's been stated fairly often, it's hard to remove something once it's put in. So it's prudent to consider a few alternative forms and rule them out, rather than try to change things later. Cheers, Ron
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4