curly-brace-aphobic?

Thomas Wouters thomas at xs4all.net
Tue Jan 30 04:33:27 EST 2001


On Mon, Jan 29, 2001 at 10:07:49PM +0000, Rainer Deyke wrote:

> None of these is really a compelling reason for using '[]' instead of '()'
> for access. 

I think the central misconception here is that you seem to think Guido made
a concious decision about everything he did in Python. I think Python uses
[] for all indexing operations, and not some other character, because Guido
thought it made sense. And you know what ? So do I, and a lot of other
people. I *especially* like the way indexing is handled the same way for all
container types, because that makes the language consistent, and doesn't
leave you with a feeling of "what do I do when I have a class/extention type
that is neither a dict nor a list, and I want to index it?" :)

Other than that, I doubt Guido thought much about what to use for indexing.
He probably also didn't think much of using ()'s for all function-alike
calls -- builtin functions, Python functions, methods on builtin types,
methods on Python types, class instantiation, Python classes pretending to
be functions. Not everything has a concious reason, Guido just made the
right decisions automatically :)

I'm-an-atheist-so-I'll-call-it-'coincidence'-ly y'rs,

-- 
Thomas Wouters <thomas at xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!




More information about the Python-list mailing list