GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • [ date ]
  • [ thread ]
  • [ subject ]
  • [ author ]

This view

  • Original page
  • New address

GeezerVison is showing mail.python.org — [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

  • Previous message: [Python-Dev] Iterable String Redux (aka String ABC)
  • Next message: [Python-Dev] Iterable String Redux (aka String ABC)
  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

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



  • Previous message: [Python-Dev] Iterable String Redux (aka String ABC)
  • Next message: [Python-Dev] Iterable String Redux (aka String ABC)
  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

More information about the Python-Dev mailing list
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.