A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2010-November/105467.html below:

[Python-Dev] Breaking undocumented API

[Python-Dev] Breaking undocumented API [Python-Dev] Breaking undocumented APIStephen J. Turnbull stephen at xemacs.org
Wed Nov 10 05:12:09 CET 2010
Nick Coghlan writes:

 > > Module writers who compound the error by expecting to be imported
 > > this way, thereby bogarting the global namespace for their own
 > > purposes, should be fish-slapped. ;)
 > 
 > Be prepared to fish-slap all of python-dev then - we use precisely
 > this technique to support optional acceleration modules. The pure
 > Python versions of pairs like profile/_profile and heapq/_heapq
 > include a try/except block at the end that does the equivalent of:
 > 
 >   try:
 >     from _accelerated import * # Allow accelerated overrides
 >   except ImportError:
 >     pass # Use pure Python versions

But these identifiers will appear at the module level, not global, no?
Otherwise this technique couldn't be used.  I don't really understand
what Tres is talking about when he writes "modules that expect to be
imported this way".  The *imported* module shouldn't care, no?  This
is an issue for the *importing* code to deal with.





More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4