LWN.net Logo

What's new in Python 2.6

What's new in Python 2.6

Posted Sep 3, 2008 13:10 UTC (Wed) by amk (subscriber, #19)
In reply to: What's new in Python 2.6 by MiguelAtWork
Parent article: What's new in Python 2.6

Regarding the 'next' example: Yes, that code would crash, but that's not breaking *existing* code; you would have to add new code that used the next() built-in, and that would simply be a coding error. Existing applications that happen to use 'next' as a variable name should be OK.


(Log in to post comments)

What's new in Python 2.6

Posted Sep 3, 2008 16:16 UTC (Wed) by MiguelAtWork (guest, #53380) [Link]

I know, sorry I wasn't clear. The situation I was thinking of is one where you're updating an application written before 2.6 but you're unaware that the application redefines e.g. next. I don't think that's too far-fetched.

What's new in Python 2.6

Posted Sep 4, 2008 2:28 UTC (Thu) by jamesh (guest, #1159) [Link]

Assuming that the code has been broken up into reasonable sized modules, this isn't usually that big a deal. You can tackle the "Python 2.6 cleanness" problem on a module by module basis. A global next variable/function in one module isn't going to shadow the builtin in other modules.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds