2007/12/13, Guilherme Polo <[EMAIL PROTECTED]>:
> 2007/12/13, Noam Raphael <[EMAIL PROTECTED]>:
> > Hello,
> >
> > Was it considered to drop the parentheses after "dict.keys()", to make
> > it "dict.keys" (that is, to make it a property instead of a method
> > with no arguments)? If it was, please forgive me - a few minutes of
> > googling didn't find it.
>
> Such thing wasn't considered, I doubt it will.

You know, that is a very well-reasoned explanation.

> >
> > I now write (another?) ordered dict, and I thought that the easiest
> > way to get the key with a given index would be "d.keys[5]". But it
> > means that d.keys is a collection of keys, not a method - and why not?
> >
>
> d.keys()[5] won't work on python 3.0 aswell because it returns a view now.
>
Let me clarify myself. I just meant to say that I think that "for x in
d.keys" looks better than "for x in d.keys()", and that if you create
a dict subclass which has ordering, "d.keys[5]" looks really better
than "d.keys()[5]".

Noam
_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to