Bug? If not, how to work around it?
Gonçalo Rodrigues
op73418 at mail.telepac.pt
Wed Aug 6 19:54:03 EDT 2003
On Wed, 6 Aug 2003 19:46:39 -0400, "Terry Reedy" <tjreedy at udel.edu>
wrote:
>
>"Gonçalo Rodrigues" <op73418 at mail.telepac.pt> wrote in message
>news:upv2jv4eeusj7bli30j7a7ikd0cq3njvm4 at 4ax.com...
>> >I changed the __iter__ method to the following, and it seems to do
>what
>> >you want:
>> >
>> > def __iter__(self):
>> > return iter(self.__obj)
>
>> But this is precisely what I don't want to do.
>
>If you don't want to do what works,
>why ask us to bother answering?
>
Because it may not work. That is, the use case I have in mind serves
as proxy for an object that may or may not have __iter__. IOW if I
stick __iter__ I have to code a second class, etc... etc... Oh well...
>TJR
>
With my best regards,
G. Rodrigues
More information about the Python-list
mailing list