<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jun 20, 2013 at 8:01 AM, Brett Cannon <span dir="ltr"><<a href="mailto:brett@python.org" target="_blank">brett@python.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote"><div class="im">On Thu, Jun 20, 2013 at 10:14 AM, Eric V. Smith <span dir="ltr"><<a href="mailto:eric@trueblade.com" target="_blank">eric@trueblade.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On 6/20/2013 9:40 AM, Nick Coghlan wrote:<br>
> On 20 June 2013 23:29, Christian Heimes <<a href="mailto:christian@python.org" target="_blank">christian@python.org</a>> wrote:<br>
>> Am 20.06.2013 15:21, schrieb Florent:<br>
>>> we already have "_pyio.py", we could have "_pystat.py".<br>
>><br>
>> Works for me.<br>
><br>
> I suggest following the guidelines in PEP 399 for cross implementation<br>
> compatibility of the standard library:<br>
> <a href="http://www.python.org/dev/peps/pep-0399/#details" target="_blank">http://www.python.org/dev/peps/pep-0399/#details</a><br>
><br>
> 1. Keep stat.py<br>
> 2. Make the C version "_stat"<br>
> 3. Add the following to the end of stat.py:<br>
><br>
>     try:<br>
>         from _stat import *<br>
>     except ImportError:<br>
>         pass<br>
><br>
> Run the tests with and without the C module in the test suite (again,<br>
> as per PEP 399).<br>
<br>
</div>Agreed with the above.<br>
<br>
But isn't the real problem with this module in Python the fact that the<br>
constants might be wrong? I'm not sure what, if anything, we can do<br>
about that.<br></blockquote><div><br></div></div><div>There isn't anything we can do beyond at least trying to provide reasonable defaults when something better isn't available (which is what the stats module has done all this time). It might make testing difficult for the Python code when the C code has the right values, but I don't think it's necessarily worth tossing out the Python code as backup.</div>


</div></div></div>
</blockquote></div><div class="gmail_extra"><br></div><div class="gmail_extra" style>If the .py file is going to be wrong or incomplete, why would we want to keep it -- or use it as fallback -- at all? If we're dead set on having a .py file instead of requiring it to be part of the interpreter (whichever that is, however it was built), it should be generated as part of the build process. Personally, I don't see the value in it; other implementations will need to do *something* special to use it anyway.</div>
<div><br></div>-- <br>Thomas Wouters <<a href="mailto:thomas@python.org" target="_blank">thomas@python.org</a>><br><br>Hi! I'm an email virus! Think twice before sending your email to help me spread!
</div></div>