Well put. Got it.
Thanks Kent
tj
* Kent Johnson <[EMAIL PROTECTED]> [051113 14:44]:
> Tim Johnson wrote:
> > * Liam Clarke-Hutchinson <[EMAIL PROTECTED]> [051113 12:41]:
> >
> >>Someone correct me if I'm wrong, but I believe there is no specific iterator
> >>object, but rather objects that have a
Tim Johnson wrote:
> * Liam Clarke-Hutchinson <[EMAIL PROTECTED]> [051113 12:41]:
>
>>Someone correct me if I'm wrong, but I believe there is no specific iterator
>>object, but rather objects that have a method for __iter___...
>
>
> Some light is slowly dawning here (I think) from
>
Johnson
> Sent: Monday, 14 November 2005 10:37 a.m.
> To: tutor@python.org
> Subject: Re: [Tutor] iteritems() vs items()
>
>
> * Kent Johnson <[EMAIL PROTECTED]> [051113 12:04]:
> > Tim Johnson wrote:
> > > Question: Can one subclass an iterator object?
>
2005 10:37 a.m.
To: tutor@python.org
Subject: Re: [Tutor] iteritems() vs items()
* Kent Johnson <[EMAIL PROTECTED]> [051113 12:04]:
> Tim Johnson wrote:
> > Question: Can one subclass an iterator object?
> > thanks for making this a little clearer.
>
> Most *classes
* Kent Johnson <[EMAIL PROTECTED]> [051113 12:04]:
> Tim Johnson wrote:
> > Question: Can one subclass an iterator object?
> > thanks for making this a little clearer.
>
> Most *classes* can be subclassed. What do you have in mind?
Oh, I'm just playing right now but what is the
iter
* John Fouhy <[EMAIL PROTECTED]> [051113 12:16]:
> On 14/11/05, Tim Johnson <[EMAIL PROTECTED]> wrote:
> > Now if I assign a value to the iteritems method, as in
> > it = s.iteritems()
> > I get an object of
> > and dir(it) shows that (it) has one public method - next().
>
> Yep. The nor
On 14/11/05, Tim Johnson <[EMAIL PROTECTED]> wrote:
> Now if I assign a value to the iteritems method, as in
> it = s.iteritems()
> I get an object of
> and dir(it) shows that (it) has one public method - next().
Yep. The normal way to use an iterator is in a for loop.
So, if you've don
Tim Johnson wrote:
> Question: Can one subclass an iterator object?
> thanks for making this a little clearer.
Most *classes* can be subclassed. What do you have in mind?
--
http://www.kentsjohnson.com
___
Tutor maillist - Tutor@python.org
http:
* Kent Johnson <[EMAIL PROTECTED]> [051112 20:33]:
> Tim Johnson wrote:
> >I need to get up to speed on iterators. I learned python 1.5~ via
> >Alan G's book ...
> >For an example, I've written a subclass of dict where keys are kept in
> >a ordered fashion is a list called __keys:
> >
> >#Here is m
Tim Johnson wrote:
> I need to get up to speed on iterators. I learned python 1.5~ via
> Alan G's book ...
> For an example, I've written a subclass of dict where keys are kept in
> a ordered fashion is a list called __keys:
>
> #Here is my items function:
> def items(self):
> """ Return a
>I need to get up to speed on iterators. I learned python 1.5~ via
> Alan G's book ...
Yeah, me too! iterators are one of the newer features of Python
that I use but haven't really played with in depth. But I guess I
really should get down to it and add a section to my tutor covering
both iter
I need to get up to speed on iterators. I learned python 1.5~ via
Alan G's book ...
For an example, I've written a subclass of dict where keys are kept in
a ordered fashion is a list called __keys:
#Here is my items function:
def items(self):
""" Return all pairs in order of addition"""
12 matches
Mail list logo