Re: suggestion for a small addition to the Python 3 list class

Discussion in 'Python' started by Lele Gaifax, Apr 21, 2013.

  1. Lele Gaifax

    Lele Gaifax Guest

    "Robert Yacobellis" <> writes:

    > I've noticed that the str join() method takes an iterable, so in the
    > most general case I'm suggesting to add a join() method to every
    > Python-provided iterable (however, for split() vs. join() it would be
    > sufficient to just add a join() method to the list class).


    That's the reasoning behind the rejection: to be friendly enough, you'd
    need to include the "join" method in the "sequence protocol", and
    implement it on every "sequence-like" object (be it some kind of
    UserList, or a generator, or an interator...)

    This question carries several references to the various threads on the
    subject:

    http://stackoverflow.com/questions/...it-string-joinlist-instead-of-list-joinstring

    ciao, lele.
    --
    nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
    real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
    | -- Fortunato Depero, 1929.
     
    Lele Gaifax, Apr 21, 2013
    #1
    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. Ishwor
    Replies:
    2
    Views:
    342
    Nick Coghlan
    Dec 27, 2004
  2. Daniel Mark
    Replies:
    9
    Views:
    12,476
    Simon Brunning
    Sep 19, 2006
  3. AEB
    Replies:
    1
    Views:
    256
    Marc 'BlackJack' Rintsch
    Oct 28, 2008
  4. Robert Yacobellis
    Replies:
    1
    Views:
    159
    Steven D'Aprano
    Apr 21, 2013
  5. Terry Jan Reedy
    Replies:
    0
    Views:
    156
    Terry Jan Reedy
    Apr 22, 2013
Loading...

Share This Page