[Python-Dev] float atime/mtime/ctime - a bad idea?

Guido van Rossum guido@python.org
Tue, 15 Oct 2002 20:47:17 -0400

I just found a place in my own code that broke because stat now
returns floats for mtime etc.  I was using a Zope "OIBTree" object,
which is a dict-like extension type mapping strings to ints; it
very reasonbly doesn't like it if you assign a float to it.

I'm not say that because *my* code breaks, this is a bad feature.  But
I am worried that we'll find more programs using external data types
that won't accept floats (I'm thinking of Numpy arrays), and I'm now
not so sure if this is acceptable breakage...  Apparently the fact
that it "works" on the Mac isn't really a great proof.

Maybe we can introduce a variant of the stat() function that returns
floats, or alternative field names that are only available when using
attributes (not when using the tuple-ish API)?

--Guido van Rossum (home page: http://www.python.org/~guido/)