[Grok-dev] Re: Iterativly emptying a grok.container shows weird
behavior
Dr. Volker Jaenisch
volker.jaenisch at inqbus.de
Tue Jun 12 13:43:23 EDT 2007
Hi Kevin!
Kevin Teague schrieb:
>
> Python 3 will have dict.keys() return an iterator and not a list:
>
> http://www.python.org/dev/peps/pep-3106/
That is quite interesting.
To quote the PEP:
> The original plan was to simply let .keys(), .values() and .items()
> return an iterator, i.e. exactly what iterkeys(), itervalues() and
> iteritems() return in Python 2.x. However, the Java Collections
> Framework [1] <http://www.python.org/dev/peps/pep-3106/#id3> suggests
> that a better solution is possible: the methods return objects with
> set behavior (for .keys() and .items()) or multiset (== bag) behavior
> (for .values()) that do not contain copies of the keys, values or
> items, but rather reference the underlying dict and pull their values
> out of the dict as needed.
So .keys() will not return an iterator but a set like operator which
also behaves like an iterator.
This is from my opinion not exactly what OOBTreeIterator is.
People mingle Lists with Arrays, Pointers with References do a lot of harm.
Lets name different things different. Nothing is more dangerous than
things that are quite the same.
Best Regards,
Volker
--
====================================================
inqbus it-consulting +49 ( 341 ) 5643800
Dr. Volker Jaenisch http://www.inqbus.de
Herloßsohnstr. 12 0 4 1 5 5 Leipzig
N O T - F Ä L L E +49 ( 170 ) 3113748
====================================================
More information about the Grok-dev
mailing list