Comment on draft PEP for deprecating six builtins

Roman Neuhauser neuhauser at mail.cz
Tue Apr 30 09:35:05 EDT 2002


> From: Duncan Booth <duncan at NOSPAMrcp.co.uk>
> Subject: Re: Comment on draft PEP for deprecating six builtins
> To: python-list at python.org
> Date: Tue, 30 Apr 2002 12:39:30 +0000 (UTC)
> 
> Bernhard Herzog <bh at intevation.de> wrote in 
> news:6qn0vlbcpk.fsf at abnoba.intevation.de:
> 
> >>     Ugh, that looks to me as appropriate as join() being a string
> >>     method / module function.
> > 
> > Exactly. I still think that join as a function makes more sense than as
> > a string method and for the same reasons as stated for chr above. Even
> > if join is implemented as a string method.
> 
> I prefer writing
>    str.join(' ', aList)
> rather than
>    ' '.join(aList)
> 
> When the string is a literal I find the former reads much better. YMMV

    IMO that's because join being a string method is just awkward. How
    does this read:
    aList.join(' ')
    After all, you tell the list to give you it's concatenation, using
    the argument as the glue.
 
> Sometimes though I take advantage of it being a method:
>    joinlines = '\n'.join
>    ...
>    s = joinlines(aList)

    This is not a method. You masked it as a global function.
 
> Note that there was a suggestion on the python-dev list to move the 
> remaining objects in the string module into the str type and then deprecate 
> the string module. So str.hexdigits instead of string.hexdigits etc.

    That should be done, of course.

-- 
FreeBSD 4.4-STABLE
3:32PM up 1 day, 5:57, 11 users, load averages: 0.01, 0.03, 0.00





More information about the Python-list mailing list