<br><br><div class="gmail_quote">On Sat, Apr 21, 2012 at 12:10, Barry Warsaw <span dir="ltr">&lt;<a href="mailto:barry@python.org">barry@python.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="HOEnZb"><div class="h5">On Apr 20, 2012, at 09:59 PM, Brett Cannon wrote:<br>
<br>
&gt;As I clean up Python/import.c and move much of its functionality into<br>
&gt;Lib/imp.py, I am about to run into some stuff that was not kept private to<br>
&gt;the file. Specifically, I have PyImport_GetMagicTag() and NullImporter_Type<br>
&gt;which I would like to chop out and move to Lib/imp.py.<br>
&gt;<br>
&gt;&gt;From my reading of PEP 384 that means I would need to at least deprecate<br>
&gt;PyImport_getMagicTag(), correct (assuming I follow through with this; I<br>
&gt;might not bother)? What about NullImporter_Type (it lacks a Py prefix so I<br>
&gt;am not sure if this is considered public or not)?<br>
<br>
</div></div>I&#39;d have to go back into my archives for the discussions about the PEP, but my<br>
recollection is that we intentionally made PyImport_GetMagicTag() a public API<br>
method.  Thus no leading underscore.  It&#39;s a bug that it&#39;s not documented, but<br>
OTOH, it&#39;s unlikely there are, or would be, many consumers for it.<br>
<br>
Strictly speaking, I do think you need to deprecate the APIs.  I like Nick&#39;s<br>
suggestion to make them C wrappers which just call back into Python.<br></blockquote><div><br></div><div>That was my plan, but the amount of code it will take to wrap them is making me not care. =) For PyImport_GetMagicTag() I would need to expose a new attribute on sys or somewhere which specifies the VM name. For PyImport_GetMagicNumber() I have to do a bunch of bit twiddling to convert a bytes object into a long which I am just flat-out not in the mood to figure out how to do. And all of this will lead to the same amount of C code as there currently is for what is already implemented, so I just don&#39;t care anymore. =)</div>

<div><br></div><div>But I&#39;m glad the clarifications are there about the stable ABI and how we are handling it. </div></div>