This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gvanrossum
Recipients
Date 2001-08-06.20:59:00
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=6380

Aaaaaaargh!!!!!!!

You mean somebody wrote a subclass of UserDict that attempts
to behave like a sequence by checking the type of the
__getitem__ argument??????????

Yuck!!!!!!!!!!!!!!!

You XML weenies are sickos. :-)

Now that I've got that out of the way :-),

Short of totally dropping dictionary iterators, the only
solution I can see it to remove the __iter__ method of
UserDict. That is backwards compatible, but it removes the
ability to iterate over UserDict instances (except for the
sick ones :-), thus making UserDict less like a dictionary.

But since UserDict is likely to become deprecated anyway in
favor of subclassing from the 'dictionary' built-in type,
this solution seems acceptable -- but only if this trick is
also in use outside the XML code.  I would prefer to see the
XML code fixed, since it can now properly define __iter__ to
iterate over whatever it wants to in any sequence it would
like. :-)
History
Date User Action Args
2007-08-23 13:55:35adminlinkissue448153 messages
2007-08-23 13:55:35admincreate