Re: a splitting headache

Discussion in 'Python' started by John Posner, Oct 22, 2009.

  1. John Posner

    John Posner Guest

    Carl Banks wrote:

    <snip>
    > s.split() and s.split(sep) do different things, and there is no string
    > sep that can make s.split(sep) behave like s.split(). That's not
    > unheard of but it does go against our typical expectations. It would
    > have been a better library design if s.split() and s.split(sep) were
    > different methods.
    >


    It looks like they *were* different methods. The Oct 1996 edition of
    "Programming Python" (O'Reilly & Assoc.), based on Python 1.3, describes
    two separate functions in the "string" module in Chapter 16:

    string.split()
    string.splitfields(delim)

    -John
    John Posner, Oct 22, 2009
    #1
    1. Advertising

  2. John Posner

    Mensanator Guest

    On Oct 22, 10:05 am, John Posner <> wrote:
    > Carl Banks wrote:
    >
    > <snip>
    >
    > > s.split() and s.split(sep) do different things, and there is no string
    > > sep that can make s.split(sep) behave like s.split().  That's not
    > > unheard of but it does go against our typical expectations.  It would
    > > have been a better library design if s.split() and s.split(sep) were
    > > different methods.

    >
    > It looks like they *were* different methods. The Oct 1996 edition of
    > "Programming Python" (O'Reilly & Assoc.), based on Python 1.3, describes
    > two separate functions in the "string" module in Chapter 16:
    >
    >  string.split()
    >  string.splitfields(delim)


    That's interesting. If string.splitfields(delim) was equivalent to
    str.split(sep), it would have been useful to add the phrase
    "str.split(sep) is equivalent to the old string.splitfields(delim)
    which no longer exists." to the docs. That way, a search on
    "splitfields" would direct the user to str.split(sep) rather than
    simply throw a dialog box saying "No topics found". No one ever
    considers making life easy for the user.

    >
    > -John
    Mensanator, Oct 22, 2009
    #2
    1. Advertising

  3. John Posner

    Paul Rudin Guest

    Mensanator <> writes:

    > No one ever considers making life easy for the user.


    That's a bizarre assertion.
    Paul Rudin, Oct 22, 2009
    #3
  4. John Posner

    Mensanator Guest

    On Oct 22, 1:22 pm, Paul Rudin <> wrote:
    > Mensanator <> writes:
    > > No one ever considers making life easy for the user.

    >
    > That's a bizarre assertion.


    I have a bad habit of doing that.
    Mensanator, Oct 22, 2009
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Ericson
    Replies:
    0
    Views:
    424
    John Ericson
    Jul 19, 2003
  2. Mark
    Replies:
    0
    Views:
    440
  3. Mensanator

    a splitting headache

    Mensanator, Oct 16, 2009, in forum: Python
    Replies:
    29
    Views:
    594
    Mensanator
    Oct 26, 2009
  4. John Posner

    Re: a splitting headache

    John Posner, Oct 22, 2009, in forum: Python
    Replies:
    2
    Views:
    312
    Gabriel Genellina
    Oct 23, 2009
  5. Replies:
    25
    Views:
    238
    Anno Siegel
    Jun 13, 2005
Loading...

Share This Page