Coding standard: Prefixing variables to indicate datatype

root at root at
Fri Jan 17 08:02:01 CET 2003

In article <c76ff6fc.0301161331.27350f1a at>, John Machin wrote:
> "Simon Burton" <simonb at> wrote in message news:<pan.2003. at>...
> 1. What is the point of reusing variable names when the function could
> be a one-liner and still quite legible:

I have to disagree here.. the point is that 3 lines is 'still quite
compact' and win in legibility, however small, is more important.

> def capit(s):
>    return "".join([x.capitalize() for x in s.split("_")])
> 2. string.join()???? Are you still using Python 1.5???? Update now!!!!

I always use string.join because ''.join feels counter-intuitive,
because you're joining list. Sort of like saying 'bank maria went to'.


 - Andrei

More information about the Python-list mailing list