Robert Brewer wrote: > Guido van Rossum: > >>>I've read and re-read Jim's message, and I'm not >>>sure I understand it. It seems he's working in >>>an interactive session but I'm not sure I >>>understand the problem he has with adding list() >>>around an expression > > > Jim Fulton wrote: > >>It's a hassle. >>... >>I'd be interested to hear if other people who have experience working >>with ZODB BTrees have been as annoyed as I've been. > > > It is a hassle. I recently changed my ORM's API from returning iterators > to lists based on similar user feedback (and I could have sworn I > already made this comment on this issue, but I can't find it now). That > experience hints to me that any interface that prefers iterators over > lists is going to be resisted; builtins doubly so.
This has been my personal experience with the iterators in SQLObject as well. The fact that an empty iterator is true tends to cause particular problems in that case, though I notice iterkeys() acts properly in this case; maybe part of the issue is that I'm actually using iterables instead of iterators, where I can't actually test the truthfulness. Another issue I have with generators (and hence iterators) is the uselessness of repr() on them. This causes a lot of list() invocations as well, which works with interactive testing, but fails badly with print statements (where you have to do another run with list() around it -- but that itself causes problems when exhausting the iterator introduces a new bug). -- Ian Bicking / [EMAIL PROTECTED] / http://blog.ianbicking.org _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
