[Httplib2-discuss] __builtins__ usage
Status: Beta
Brought to you by:
jcgregorio
From: Sanghyeon S. <sa...@gm...> - 2006-12-18 08:38:50
|
Hello, I am trying to run httplib2 on IronPython. And the first hurdle is the usage of __builtins__ in httplib2. Python Library Reference states: http://docs.python.org/lib/module-builtin.html "As an implementation detail, most modules have the name __builtins__ (note the "s") made available as part of their globals. The value of __builtins__ is normally either this module or the value of this modules's __dict__ attribute. Since this is an implementation detail, it may not be used by alternate implementations of Python." And indeed it isn't. So I'd like this to be changed. Current code: if 'sorted' not in __builtins__: # replacement code Suggestion 1: try: sorted except NameError: # replacement code Suggestion 2: if sys.version_info < (2, 4): # replacement code -- Seo Sanghyeon |