[issue20729] mailbox.Mailbox does odd hasattr() check

2014-08-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5fd1f8271e8a by Serhiy Storchaka in branch '3.4': Issue #20729: Restored the use of lazy iterkeys()/itervalues()/iteritems() http://hg.python.org/cpython/rev/5fd1f8271e8a New changeset acb30ed7eceb by Serhiy Storchaka in branch 'default': Issue

[issue20729] mailbox.Mailbox does odd hasattr() check

2014-08-13 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20729 ___

[issue20729] mailbox.Mailbox does odd hasattr() check

2014-08-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If there are no objections I'll commit this patch. -- assignee: - serhiy.storchaka versions: +Python 3.5 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20729

[issue20729] mailbox.Mailbox does odd hasattr() check

2014-08-12 Thread R. David Murray
R. David Murray added the comment: Committing the patch seems like the right thing to do at this point in time. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20729 ___

[issue20729] mailbox.Mailbox does odd hasattr() check

2014-02-22 Thread Chris Angelico
New submission from Chris Angelico: Only noticed because I was searching the stdlib for hasattr calls, but in mailbox.Mailbox.update(), a check is done thus: if hasattr(arg, 'iteritems'): source = arg.items() elif hasattr(arg, 'items'): source =

[issue20729] mailbox.Mailbox does odd hasattr() check

2014-02-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Actually it should be iteritems(). This is meant to support Mailbox, which has both iteritems() and items() methods. iteritems() returns an iterator and items() returns a list. Looks as changeset f340cb045bf9 was incorrectly applied to mailbox. Here is a

[issue20729] mailbox.Mailbox does odd hasattr() check

2014-02-22 Thread Terry J. Reedy
Terry J. Reedy added the comment: You have opened the door on a slight mess. The mailbox module provides a set + dict interface to on-disk mailbax files in various formats. The hg annotate and revision history commands indicate that most of 3.4 mailbox is unchanged since the trunk version was

[issue20729] mailbox.Mailbox does odd hasattr() check

2014-02-22 Thread Peter Otten
Peter Otten added the comment: Do you expect many use cases that rely on items(), keys(), and values() being lists? Maybe it would be acceptable to make these lazy in 3.5, but keep the iterXXX() variants as aliases indefinitely. -- nosy: +peter.otten

[issue20729] mailbox.Mailbox does odd hasattr() check

2014-02-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Note that there is a difference between Mailbox and dict interface: __iter__() iterates over values, not keys. clear() should use keys(), not iterkeys(), because it modifies iterated dict. -- ___ Python tracker