Is it a typo that it says "...builtin__'> is not enumerable" (vs builtins)?
Would a solution be to implement the enumerable mechanism (over the names of the attributes) for __builtins__ ? That would not be hard to do (I don't think) and would be unlikely to cause much trouble. At 10:10 AM 1/27/2007, Sanghyeon Seo wrote >In CPython, __builtins__ is a module for the main script, but it is a >dictionary for modules. This is quite confusing, and this behaviour is >explicitly stated as an implementation detail. As far as I can tell, >it is always a module in IronPython. > >http://docs.python.org/lib/module-builtin.html > >However, far too many existing CPython sources break beacuse of this >on IronPython for my taste. The symptom is: > >TypeError: <type '__builtin__'> is not enumerable > >This is usually caused by well-intended codes as following: > >if 'sorted' not in __builtins__: > def sorted(seq): > seq = seq[:] > seq.sort() > return seq > >This lets one to keep compatibility with CPython versions before 2.4, >while still using 2.4-introduced sorted() builtin. > >Here are some existing usages: >http://www.google.com/codesearch?q=%22in+__builtins__%22 J. Merrill / Analytical Software Corp _______________________________________________ users mailing list [email protected] http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
