A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-May/079818.html below:

[Python-Dev] Iterable String Redux (aka String ABC)

[Python-Dev] Iterable String Redux (aka String ABC) [Python-Dev] Iterable String Redux (aka String ABC)Armin Ronacher armin.ronacher at active-4.com
Tue May 27 23:19:49 CEST 2008
Hi,

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".)
It surely is, but it would probably make sense to require both.  Maybe have
something like this:

  class SymbolSequence(Sequence)
  class String(SymbolSequence)

String would be the base of str/unicode and CharacterSequence of str/bytes.
A SymbolSequence is basically a sequence based on one type of symbols that
implements slicing, getting symbols by index, count() and index().  A String
is basically everything a str/unicode provides as method except of those
which depend on informatio based on the symbol.  For example upper() /
isupper() etc would go.  Additionally I guess it makes sense to get rid of
encode() / decode() / format().

Regards,
Armin


More information about the Python-Dev mailing list

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