[Python-Dev] bpo-36558: Change time.mktime() return type from float to int?

Guido van Rossum guido at python.org
Tue Apr 16 11:46:31 EDT 2019


On Tue, Apr 16, 2019 at 8:19 AM Victor Stinner <vstinner at redhat.com> wrote:

> Le mar. 16 avr. 2019 à 16:44, Paul Ganssle <paul at ganssle.io> a écrit :
> > 2. Mainly for Victor, but anyone can answer: I agree that the natural
> output of `mktime()` would be `int` if I were designing it today, but would
> there be any practical benefits for making this change?
>
> It's just for the consistency of the function regarding to C function
> mktime() return type and its input types :-)
>

But all Python times are reported or accept floats -- this allows
sub-second precision without using complicated data structures. None of the
C functions use floats. Consistency with C should not be the issue --
consistency between the time functions is important.


> > Are there problems cropping up because it's returning a float?
>
> None.
>

So let's drop the idea.


> Victor
> --
> Night gathers, and now my watch begins. It shall not end until my death.
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> https://mail.python.org/mailman/options/python-dev/guido%40python.org
>


-- 
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him/his **(why is my pronoun here?)*
<http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20190416/7c4f2cc1/attachment.html>


More information about the Python-Dev mailing list