Coding standard: Prefixing variables to indicate datatype
root at silmarill.org
root at silmarill.org
Fri Jan 17 02:02:01 EST 2003
In article <c76ff6fc.0301161331.27350f1a at posting.google.com>, John Machin wrote:
> "Simon Burton" <simonb at webone.com.au> wrote in message news:<pan.2003.01.16.09.42.41.751206 at webone.com.au>...
> 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'.
[snip]
- Andrei
More information about the Python-list
mailing list