Coding standard: Prefixing variables to indicate datatype

Andrew Bennetts andrew-pythonlist at puzzling.org
Sat Jan 18 19:56:20 EST 2003


On Sat, Jan 18, 2003 at 11:58:08AM -0500, Jp Calderone wrote:
> On Sat, Jan 18, 2003 at 05:33:39PM +0100, Daniel Dittmar wrote:
> > 
> > Now that there are class methods, there's no longer the need to force 
> > this into a instance method call. str.join (somelist [, joinstring]) 
> > does the job just fine.
> 
>   Sure, it would work, but *why*?  I don't see join as making any sense as a
> class method.

If string.join(seq, sep) is readable, then presumably str.join(sep, seq)
isn't too far off.

One argument I've heard from a relative python newbie is that they didn't
like ''.join because it seemed like object-orientation taken too far.
Presumably they consider joining a string to be a straightforward procedural
thing, but the other thing is that people do expect lists, not strings, to
have a .join method, despite the obvious problem that not every sequence is
a list.

-Andrew.






More information about the Python-list mailing list