Coding standard: Prefixing variables to indicate datatype

Carl Banks imbosol at vt.edu
Sun Jan 19 16:17:31 EST 2003


Jp Calderone wrote:
> [-- text/plain, encoding quoted-printable, 30 lines --]
> 
> On Sun, Jan 19, 2003 at 07:32:09PM +0000, Hans Nowak wrote:
>> Terry Reedy wrote:
>> 
>> [join method]
>> >And likewise, admitting that it is a bit ugly, at least to some,
>> >is no exclusion to thinking that it is very handy to have it
>> >directly available, just like its quasi-inverse, .split(),
>> >and with the same syntax.
>> 
>> If the join operation is done by calling a method on the separator, I would 
>> expect the same on the split operation:
>> 
>>   " ".split("a b c")
>>   # should yield ["a", "b", "c"]
>> 
>> ...but for some reason, that didn't make it into the design. ;-)
> 
>  "A foolish consistency is the hobgoblin of little minds."  -rwe
> 
>  "a b c".split(" ") makes sense.  " ".join(("a", "b", "c")) does, too.
> ("a", "b", "c").join(" ") might make sense, but it would also involve
> writing a pile more code, and reducing the usefulness of the operation.  So
> why aim for consistency, when we can achieve usefulness instead?

He wasn't asking for ("a", "b", "c").join(" "), chief.  Reading is
fundamental.


-- 
CARL BANKS




More information about the Python-list mailing list