On 2-Apr-08, at 3:33 PM, Jason Orendorff wrote: > On Wed, Apr 2, 2008 at 5:08 PM, Mike Klaas <[EMAIL PROTECTED]> > wrote: >> ...and the majority of these cases would work fine with views (input >> to sorted(), etc). > > Suppose "the majority" here means 36 of the 46 cases. Then what > you're saying is, if I write .items() without thinking, there's about > a 3% chance it won't work (10 out of 339 cases). Forgive me: the > fact that you've gotten it down to 3%, e.g. by making items() return a > view instead of an iterator, doesn't make me terrifically happy.
I apologize: I wasn't trying to make the point that programmers used to the old behaviour can continue willy-nilly using it without worrying about the consequences. Yes, programmers will have to learn the new behaviour; these are among the subtleties of the new language. I suspect that it will be mentioned prominently in every "python 3k for 2.X programmers" tutorial, and 2to3 can handle this translation safely. I suspect that most cases will not fail quietly, either: l = d.keys() l.sort() # exception l[0] # exception etc. (there may be other examples, too, like sliceability) -Mike _______________________________________________ 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
