(original) (raw)

Hello,

I was looking at the possibility of replacing the SEEK\_\* constants by IntEnums, and the first thing that catches attention is that these constants are defined in both Lib/os.py and Lib/io.py; both places also recently started supporting SEEK\_HOLE and SEEK\_DATA (though here io refers to os.SEEK\_HOLE and os.SEEK\_DATA).


Additional data points: other modules take these constants as arguments -

* mmap: directs to use os.SEEK_*
* chunk and fcntk: spell out the numeric values.

os seems to import io in some functions; can this be done always? If yes, we can just define the constants once and os.SEEK_* will alias io.SEEK_*? The other way (io taking from os) is also a possibility (maybe the preferred one because io already refers to os.SEEK_HOLE/DATA, at least in the documentation).


Any ideas and suggestions are welcome,

Eli