Antoine Pitrou schrieb: > Georg Brandl <g.brandl <at> gmx.net> writes: >> I'd argue that "find" is more primitive than "split" -- split is intuitively >> implemented using find and slicing, but implementing find using split and >> len is unintuitive. (Of course, "index" can be used instead of "find".) > > I meant semantically primitive. I think the difference between a String and a > plain Sequence is that, in a String, the existence and relative position of > substrings has a meaning. This is true for character strings but it can also be > true for other kinds of strings (think genome strings, they are usually > represented using ASCII letters but it's out of convenience - they could be made > of opaque objects instead). > > That's why, in string classes, you have methods like split() to deal with the > processing of substrings - which you do not have on lists, not that's it more > difficult to implement or algorithmically less efficient, but because it makes > no point. > > Well I hope it makes at least a bit of sense :-) It does, but I don't see how it contradicts my proposition. find() takes a substring as well. Georg
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