<div class="gmail_quote">On Fri, Feb 20, 2009 at 1:44 PM, Brett Cannon <span dir="ltr"><<a href="mailto:brett@python.org">brett@python.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Now, from what I can tell, Antoine is suggesting having _pyio and a _io and then io is simply:<br><br> try: from _io import *<br> except ImportError: from _pyio import *<br><br>That works for testing as you can then have test classes have an attribute for the module to use and then create two subclasses which set what module to use (kind of like how test_warnings currently does it). But this only really works for complete module replacements, not modules like pickle where only key portions have been rewritten (which happens more often than the complete rewrite).<br>
</blockquote><div><br></div></div>A slight change would make it work for modules where only key functions have been rewritten. For example, pickle.py could read:<br><br>from _pypickle import *<br>try: from _pickle import *<br>
except ImportError: pass<br><blockquote style="margin: 1.5em 0pt;">--<br>
Daniel Stutzbach, Ph.D.<br>
President, <a href="http://stutzbachenterprises.com">Stutzbach Enterprises, LLC</a>
</blockquote>