Coding standard: Prefixing variables to indicate datatype

Jp Calderone exarkun at intarweb.us
Sun Jan 19 15:59:48 EST 2003


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?

  Jp

--
 12:00am up 34 days, 9:48, 3 users, load average: 0.23, 0.25, 0.22
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20030119/3e16f1a5/attachment.sig>


More information about the Python-list mailing list