Re: Python stdlib code that looks odd

2014-02-22 Thread Chris Angelico
On Sat, Feb 22, 2014 at 10:54 PM, Peter Otten <__pete...@web.de> wrote: > Please file a bug report. http://bugs.python.org/issue20729 created. ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: Python stdlib code that looks odd

2014-02-22 Thread Peter Otten
Chris Angelico wrote: > I'm poking around in the stdlib, and Lib/mailbox.py has the following > inside class Mailbox: > > def update(self, arg=None): > """Change the messages that correspond to certain keys.""" > if hasattr(arg, 'iteritems'): > source = arg.items()

Python stdlib code that looks odd

2014-02-22 Thread Chris Angelico
I'm poking around in the stdlib, and Lib/mailbox.py has the following inside class Mailbox: def update(self, arg=None): """Change the messages that correspond to certain keys.""" if hasattr(arg, 'iteritems'): source = arg.items() elif hasattr(arg, 'items'):