Re: [Python-3000] Automatically invoking str() in str.join()

2006-05-02 Thread Fredrik Lundh
Michael P. Soulier wrote: > > which, based on the law of design based on random sampling of c.l.python, > > indicates that the current situation is not optimal. > > I for one found the move to put join() as a string method _very_ > unintiutive, and rather arbitrary. Lets just be different for the

Re: [Python-3000] Automatically invoking str() in str.join()

2006-05-01 Thread Michael P. Soulier
On 4/30/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > for the record, this just appeared on comp.lang.python: > > hello everyone! I can't seem to find a function that combines a list of > items into a string with a seperator between the individual elements.. > > which, based on the law of

Re: [Python-3000] Automatically invoking str() in str.join()

2006-05-01 Thread Michael Goral
> Thomas Wouters wrote: > "I disagree, and I believe that would be a big mistake to change it." seems to me that Thomas is right here ... some remarks by a recent arrival at Python, my initial offset was version 2.4.0: I think cleaning up things to ease newbie adaptation is often misleading I vi

Re: [Python-3000] Automatically invoking str() in str.join()

2006-05-01 Thread Antoine Pitrou
Le lundi 01 mai 2006 à 10:57 +0200, Fredrik Lundh a écrit : > Thomas Wouters wrote: > > > > join() > > > > > > it's time to make this a builtin. the "it's the separator that's doing > > > the > > > joining" idea is silly and unintuitive, and should be fixed. > > > > > > I disagree, and I believe

Re: [Python-3000] Automatically invoking str() in str.join()

2006-05-01 Thread Walter Dörwald
Nick Coghlan wrote: > Thomas Wouters wrote: >> It doesn't matter. Either case is confusing, one way or another, as Tim >> has already argued. Changing it would be a big mistake. If you want me >> to come with more comprehensive arguments (other than what Tim already >> covered), please come with

Re: [Python-3000] Automatically invoking str() in str.join()

2006-05-01 Thread Fredrik Lundh
Nick Coghlan wrote: > What if the join() builtin had a similar signature to min() & max(), and the > separator was a keyword only argument? +0.5 (clever) ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/py

Re: [Python-3000] Automatically invoking str() in str.join()

2006-05-01 Thread Nick Coghlan
Thomas Wouters wrote: > It doesn't matter. Either case is confusing, one way or another, as Tim > has already argued. Changing it would be a big mistake. If you want me > to come with more comprehensive arguments (other than what Tim already > covered), please come with more comprehensive argume

Re: [Python-3000] Automatically invoking str() in str.join()

2006-05-01 Thread Fredrik Lundh
Thomas Wouters wrote: > > can anyone point to one other example where "call method on > > literal" is used in Python ? > > It doesn't matter. it doesn't matter to you when the preferred way to do things don't look like Python code? > Either case is confusing, one way or another, as Tim has > alr

Re: [Python-3000] Automatically invoking str() in str.join()

2006-05-01 Thread Thomas Wouters
On 5/1/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: Thomas Wouters wrote:> > join()> >> > it's time to make this a builtin.  the "it's the separator that's doing> > the> > joining" idea is silly and unintuitive, and should be fixed. >>> I disagree, and I believe that would be a big mistake to chang

Re: [Python-3000] Automatically invoking str() in str.join()

2006-05-01 Thread Fredrik Lundh
Thomas Wouters wrote: > > join() > > > > it's time to make this a builtin. the "it's the separator that's doing > > the > > joining" idea is silly and unintuitive, and should be fixed. > > > I disagree, and I believe that would be a big mistake to change it. big mistake? can anyone point to one

Re: [Python-3000] Automatically invoking str() in str.join()

2006-05-01 Thread Thomas Wouters
On 4/27/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: join()it's time to make this a builtin.  the "it's the separator that's doing thejoining" idea is silly and unintuitive, and should be fixed.I disagree, and I believe that would be a big mistake to change it. -- Thomas Wouters <[EMAIL PROTECTED]>

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-30 Thread Greg Ewing
Fredrik Lundh wrote: > join() > > it's time to make this a builtin. the "it's the separator that's doing the > joining" idea is silly and unintuitive, and should be fixed. +1 -- Greg ___ Python-3000 mailing list Python-3000@python.org http://mail.pyth

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-30 Thread Fredrik Lundh
Tim Peters wrote: > Let's see. Should I watch a movie now, or search pre-string-method > archives for quotes nobody really cares about? While I think about > that ;-), you could look in _this_ thread for: well, designing things based on how old farts think things where back in the old days isn'

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-29 Thread Antoine Pitrou
Le samedi 29 avril 2006 à 02:07 -0400, Tim Peters a écrit : > If you don't remember these confusions, I think it should suffice to > remind that Perl's join() does take the separator first (which is > essentially forced in Perl, given its odd LIST syntax): PHP's join does too, also some versions h

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-28 Thread Tim Peters
[Fredrik] >>> I don't think anyone on this list can take the "but if there's more than >>> one argument, *I* am going to be confused" argument seriously. [Tim] >> Then you don't remember that the order of arguments here _was_ a >> frequent confusion in the old days. [Fredrik] > nope. > > any poin

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-28 Thread Jack Diederich
On Fri, Apr 28, 2006 at 01:02:44AM -0400, Terry Reedy wrote: > > "Brett Cannon" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > I wouldn't want it added without ditching the other two versions as > > well. Personally I would be fine if string.join() stayed and we > > considered

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-28 Thread Fredrik Lundh
Tim Peters wrote: >> I don't think anyone on this list can take the "but if there's more than >> one argument, *I* am going to be confused" argument seriously. > > Then you don't remember that the order of arguments here _was_ a > frequent confusion in the old days. nope. any pointers ? __

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Terry Reedy
"Brett Cannon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I wouldn't want it added without ditching the other two versions as > well. Personally I would be fine if string.join() stayed and we > considered removing str.join() and just made the string module more > prominent (af

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Crutcher Dunnavant
On 4/27/06, Alex Martelli <[EMAIL PROTECTED]> wrote: > On 4/27/06, Barry Warsaw <[EMAIL PROTECTED]> wrote: > > On Thu, 2006-04-27 at 10:08 -0700, Aahz wrote: > > > > > While I hate the way it looks, I never have gotten mixed up about the > > > order of arguments since switching to ''.join(l). > > >

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Brett Cannon
On 4/27/06, Tim Peters <[EMAIL PROTECTED]> wrote: > [Fredrik Lundh] > > no, because people enjoy writing readable code. doing things by exe- > > cuting methods attached to literals isn't very readable, and isn't used > > for anything else. > > As Barry often says, he spells it TAB.join() or BLANK.

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Tim Peters
[Alex Martelli, suggests that a functional join's default separator be the empty string] >> Rationale: an emptystring joiner is the most frequent cases, but >> several others (space, newline, space-comma, ...) occur often enough >> to be worth allowing the joiner to be optionally specified. [Barr

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Barry Warsaw
On Thu, 2006-04-27 at 10:18 -0700, Alex Martelli wrote: > > ''.join(seq) == join('', seq) > > I think I would prefer a signature of: > join(seq, joiner='') Except that I think it would be a mistake to have that and keep the .join() method on strings because that would increase the confusion

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Steven Bethard
On 4/27/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Phillip J. Eby wrote: > > > And thanks to the time machine, str.join('', seq) does this already: > > > > Python 2.2.2 (#1, Feb 24 2003, 19:13:11) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-4)] on linux2 > > Type "help", "copyright", "credits"

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Jack Diederich
On Thu, Apr 27, 2006 at 10:18:23AM -0700, Alex Martelli wrote: > On 4/27/06, Barry Warsaw <[EMAIL PROTECTED]> wrote: > > On Thu, 2006-04-27 at 10:08 -0700, Aahz wrote: > > > > > While I hate the way it looks, I never have gotten mixed up about the > > > order of arguments since switching to ''.join

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Fredrik Lundh
Phillip J. Eby wrote: > And thanks to the time machine, str.join('', seq) does this already: > > Python 2.2.2 (#1, Feb 24 2003, 19:13:11) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-4)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> str.join('',['a','b','c

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Tim Peters
[Fredrik Lundh] > no, because people enjoy writing readable code. doing things by exe- > cuting methods attached to literals isn't very readable, and isn't used > for anything else. As Barry often says, he spells it TAB.join() or BLANK.join() (etc) instead. That's very readable. > I don't think

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Phillip J. Eby
At 07:16 PM 4/27/2006 +0200, Barry Warsaw <[EMAIL PROTECTED]> wrote: > But hey, yeah, a join() builtin would be fine if it >took the string arg first, so that > >''.join(seq) == join('', seq) And thanks to the time machine, str.join('', seq) does this already: Python 2.2.2 (#1, Feb 24 2003, 19:1

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Fredrik Lundh
Tim Peters wrote: > > In which case why would we need a builtin? > > Because people enjoy arguing about the best order for the arguments, > and about the best default separator value, neither of which you _can_ > argue about in the method spelling ;-) no, because people enjoy writing readable cod

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Tim Peters
[Barry Warsaw] >> ... >> While I hate the way it looks, I never have gotten mixed up about the >> order of arguments since switching to ''.join(l). [Tim Hochberg] > Me too on all counts including the -0. >> ... >> But hey, yeah, a join() builtin would be fine if it >> took the string arg first, s

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Guido van Rossum
On 4/27/06, Georg Brandl <[EMAIL PROTECTED]> wrote: > As a side note, I named the thing "string.join()" because I didn't know what > to > write. The str type will be dead, and I assume that the new string type will > have a different name. > > Will it be "unicode"? Or "text"? Or "string"? "str" o

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Tim Hochberg
Barry Warsaw wrote: > On Thu, 2006-04-27 at 10:08 -0700, Aahz wrote: >> -0 >> >> >>While I hate the way it looks, I never have gotten mixed up about the >>order of arguments since switching to ''.join(l). Me too on all counts including the -0. > > > Which is why > > EMPTYSTRING = '' > > ..

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Alex Martelli
On 4/27/06, Barry Warsaw <[EMAIL PROTECTED]> wrote: > On Thu, 2006-04-27 at 10:08 -0700, Aahz wrote: > > > While I hate the way it looks, I never have gotten mixed up about the > > order of arguments since switching to ''.join(l). > > Which is why > > EMPTYSTRING = '' > > ... > > EMPTYSTRING.join(s

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Barry Warsaw
On Thu, 2006-04-27 at 10:08 -0700, Aahz wrote: > While I hate the way it looks, I never have gotten mixed up about the > order of arguments since switching to ''.join(l). Which is why EMPTYSTRING = '' ... EMPTYSTRING.join(seq) looks much better. But hey, yeah, a join() builtin would be fine

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Aahz
On Thu, Apr 27, 2006, Raymond Hettinger wrote: > Ivan Krstic wrote: >>Fredrik Lundh wrote: >>> >>>it's time to make this a builtin. the "it's the separator that's doing the >>>joining" idea is silly and unintuitive, and should be fixed. >> >>+1 on this; I've thought this for a long time. > > Stron

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Raymond Hettinger
Ivan Krstic wrote: >Fredrik Lundh wrote: > > >>it's time to make this a builtin. the "it's the separator that's doing the >>joining" idea is silly and unintuitive, and should be fixed. >> >> > >+1 on this; I've thought this for a long time. > > > Strong +1. This fixes a long-standing micr

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Ivan Krstic
Fredrik Lundh wrote: > it's time to make this a builtin. the "it's the separator that's doing the > joining" idea is silly and unintuitive, and should be fixed. +1 on this; I've thought this for a long time. -- Ivan Krstic <[EMAIL PROTECTED]> | GPG: 0x147C722D __

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Fredrik Lundh
Georg Brandl wrote: > As a side note, I named the thing "string.join()" because I didn't know what > to > write. join() it's time to make this a builtin. the "it's the separator that's doing the joining" idea is silly and unintuitive, and should be fixed. _

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Georg Brandl
Nick Coghlan wrote: > Georg just added the idea of automatically invoking str() in str.join() to > PEP > 3100 with a question mark on the end. I thought I'd responded when Talin > first > brought it up, but couldn't find a record of that in the archive (this is why > one suggestion per message

[Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Nick Coghlan
Georg just added the idea of automatically invoking str() in str.join() to PEP 3100 with a question mark on the end. I thought I'd responded when Talin first brought it up, but couldn't find a record of that in the archive (this is why one suggestion per message is a good idea ;) I tried to imp