mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
Default stat_float_times to true.
This commit is contained in:
parent
22b457e03b
commit
fe33d0ba87
3 changed files with 9 additions and 11 deletions
|
@ -1012,17 +1012,13 @@ objects. If newval is True, future calls to stat() return floats, if
|
||||||
it is False, future calls return ints. If newval is omitted, return
|
it is False, future calls return ints. If newval is omitted, return
|
||||||
the current setting.
|
the current setting.
|
||||||
|
|
||||||
For compatibility with older Python versions, accessing
|
\versionchanged[Python now returns float values by default. Applications
|
||||||
\class{stat_result} as a tuple always returns integers. For
|
which do not work correctly with floating point time stamps can use
|
||||||
compatibility with Python 2.2, accessing the time stamps by field name
|
this function to restore the old behaviour]{2.5}
|
||||||
also returns integers. Applications that want to determine the
|
|
||||||
fractions of a second in a time stamp can use this function to have
|
|
||||||
time stamps represented as floats. Whether they will actually observe
|
|
||||||
non-zero fractions depends on the system.
|
|
||||||
|
|
||||||
Future Python releases will change the default of this setting;
|
The resolution of the timestamps (i.e. the smallest possible fraction)
|
||||||
applications that cannot deal with floating point time stamps can then
|
depends on the system. Some systems only support second resolution;
|
||||||
use this function to turn the feature off.
|
on these systems, the fraction will always be zero.
|
||||||
|
|
||||||
It is recommended that this setting is only changed at program startup
|
It is recommended that this setting is only changed at program startup
|
||||||
time in the \var{__main__} module; libraries should never change this
|
time in the \var{__main__} module; libraries should never change this
|
||||||
|
|
|
@ -22,6 +22,8 @@ Core and builtins
|
||||||
Extension Modules
|
Extension Modules
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
- stat_float_times is now True.
|
||||||
|
|
||||||
- array.array objects are now picklable.
|
- array.array objects are now picklable.
|
||||||
|
|
||||||
- the cPickle module no longer accepts the deprecated None option in the
|
- the cPickle module no longer accepts the deprecated None option in the
|
||||||
|
|
|
@ -789,7 +789,7 @@ statresult_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
||||||
|
|
||||||
|
|
||||||
/* If true, st_?time is float. */
|
/* If true, st_?time is float. */
|
||||||
static int _stat_float_times = 0;
|
static int _stat_float_times = 1;
|
||||||
|
|
||||||
PyDoc_STRVAR(stat_float_times__doc__,
|
PyDoc_STRVAR(stat_float_times__doc__,
|
||||||
"stat_float_times([newval]) -> oldval\n\n\
|
"stat_float_times([newval]) -> oldval\n\n\
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue