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

Florent florent.xicluna at gmail.com
Thu Jun 20 15:21:13 CEST 2013

we already have "_pyio.py", we could have "_pystat.py".

my 2c

Florent Xicluna

2013/6/20 Christian Heimes <christian at python.org>:
> Hello,
> I have re-implemented the entire stat module in C. [1] It's a necessary
> step to fix portability issues. For most constants POSIX standards
> dictate only the name of the constant and its meaning but not its value.
> Only the values of permission bits (0644 == rw-r--r--) have fixed values.
> For example S_IFDIR is usually 0o40000 but it might be 0o20000 on some
> platforms. Common file types seem to have the same value on all
> important platforms. It's the only reason we were able to get away with
> stat.py. But uncommon file types like door, event port and whiteout
> don't have sensible default values. The C implementation is able to pick
> up the platform's values easily.
> What shall I do about stat.py? statmodule.c implements all features of
> stat.py so there is no point in using it in CPython. It's one Python
> file less to load on every startup. However it might still be useful to
> alternative implementations of Python such as Jython or PyPy.
> 1) keep the file stat.py but let it be shadowed by the builtin stat
> module. Antoine loathes my hack...
> 2) rename stat.py to _stat.py
> 3) remove stat.py
> Opinions?
> Christian
> [1] http://bugs.python.org/issue11016
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: http://mail.python.org/mailman/options/python-dev/florent.xicluna%40gmail.com

More information about the Python-Dev mailing list