[Python-Dev] stat module in C -- what to do with stat.py?

Cameron Simpson cs at zip.com.au
Sat Jun 22 03:42:02 CEST 2013

On 20Jun2013 08:35, Benjamin Peterson <benjamin at python.org> wrote:
| 2013/6/20 Charles-François Natali <cf.natali at gmail.com>:
| > 2013/6/20 Thomas Wouters <thomas at python.org>:
| >> 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.
| >
| > That's exactly my rationale for pushing for removal.
| +1 to nixing it.

-1 to nixing it.

I think there should be a pure python reference implementation.
If it exposes only the portable constants/macros or, better, has a
machine generated _section_ for the local platform macros, all to
the good; it would not lie.

- A huge amount of code only needs to care about the portable stuff
  (is this a dir, is this a regular file, is it neither).
  Missing local constants won't break such code.

- A reference implementation exposes algorithms and purpose in a
  common language (Python, of course; everyone caring about such
  an impl can already read Python:-).

- A reference implementation provides a base for other implementations
  to use outright, or to build on.

- A reference implementation provides something to test against for
  comparison of the common stuff.

- The implementation cost is low; the ref implementation already exists!

Getting rid of it seems mad. Pruning/fixing/adapting the nonportable
bits might be good. Christian Heimes' test patch would make that
much easier to identify.

So, -1 on removal of stat.py.

Cameron Simpson <cs at zip.com.au>

I will not do it as a hack       I will not do it for my friends
I will not do it on a Mac        I will not write for Uncle Sam
I will not do it on weekends     I won't do ADA, Sam-I-Am
        - Gregory Bond <gnb at bby.com.au>

More information about the Python-Dev mailing list