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 gvanrossum, neologix, pitrou, vstinner
Date 2013-10-06.14:48:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1381070902.41.0.865638927541.issue19172@psf.upfronthosting.co.za>
In-reply-to
Content
No time to follow this in detail, but one thing: please do not make the selector appear "false" under *any* circumstances. I've seen too many code write "if foo" where they meant "if foo is not None" and get in trouble because foo wasn't None but happened to have no content. (See e.g. recent issue 19097, although the situation there is even more complicated.) (And for things formally deriving from Container it's a different thing. But that shouldn't be done lightly.)

I think it's useful to be able to get the keys; it would be nice if that was an O(1) operation so you can also check for emptiness without needing a second method. Perhaps the method shouldn't be called keys() to avoid any confusion with subclasses of the Container ABC?
History
Date User Action Args
2013-10-06 14:48:22gvanrossumsetrecipients: + gvanrossum, pitrou, vstinner, neologix
2013-10-06 14:48:22gvanrossumsetmessageid: <1381070902.41.0.865638927541.issue19172@psf.upfronthosting.co.za>
2013-10-06 14:48:22gvanrossumlinkissue19172 messages
2013-10-06 14:48:22gvanrossumcreate