70Re: [python-iter] Colon syntax: We barely knew thee...
- Mar 3, 2001From: <qrczak@...>
> Sat, 3 Mar 2001 11:23:31 +0100, gzeljko <gzeljko@...> pisze:a=some_dict.keys() # a going to be 'list'
> > > Why not 3: Requires much internal magic to let such lazy list behave
> > > in an almost-compatible way with the old regular list - not
> > > sure if it can be done well at all. Breaks code which
> > > expected type(dict.keys()) == types.ListType.
> > Requires diferent evaluation of dict.keys() in diferent context.
> It does not. It would always be a lazy list, which provides both
> a sequence protocol and an iteration protocol.
In others words, they 'must' implement complete list interface,
1. without own backing store
2. with own backing store on demand
1. is clear concept, but here is imposible
a[i] = something
# can't be implemented with old meaning
2. is confusing and impractical (IMHO)
- << Previous post in topic Next post in topic >>