[Python-Dev] stat module in C -- what to do with stat.py?
Terry Reedy
tjreedy at udel.edu
Fri Jun 21 18:28:57 CEST 2013
On 6/21/2013 7:45 AM, Antoine Pitrou wrote:
> Le Fri, 21 Jun 2013 21:39:10 +1000,
> Nick Coghlan <ncoghlan at gmail.com> a écrit :
>> I think it's OK to expose additional platform specific features in the
>> C version, and have them fail cleanly with the pure Python version
>> (rather than silently giving the wrong answer).
>
> PEP 399 says we don't do it:
>
> "Acting as a drop-in replacement also dictates that no public API be
> provided in accelerated code that does not exist in the pure Python
> code. Without this requirement people could accidentally come to rely
> on a detail in the accelerated code which is not made available to
> other VMs that use the pure Python implementation."
Any C accelerator extensions should by documented as CPython extensions
not necessarily available elsewhere. Or the doc should have, in this
case, a separate _stat that says "In addition to the above, CPython's
_stat, imported by stat, also provides ...
--
Terry Jan Reedy
More information about the Python-Dev
mailing list