l_fp, time, calendar

Hal Murray hmurray at megapathdsl.net
Sat Mar 25 22:07:18 UTC 2017


esr at thyrsus.com said:
>> There is some pretty date stuff using l_fp called from python.
>> I vote we write some python code that converts l_fp into a
>> python time.  Eventually, it will have to pivot but we can punt
>> for a few years.

> Not seeing a point in this unless it removes the last blocker to getting rid
> of prettydate() entirely. 

It's not a well thought area.

There are two date/time to text modules.  That seems like one too many.  This 
whole area feels ripe for more cleanup.

I think one of the routines in prettydate is only used by python.  This feels 
like at area where if we start getting rid of things then we can get rid of 
more things that nobody else uses.

The current python code depends on a bunch of c routines.  Trimming that list 
seems like progress, especially if there are no other users of the target 
routines in the c world.  It would be neat if we could remove l_fp from that 
interface.

--------

Why does that interface have lfptofloat and why is it messing with hex stuff?
    if (!PyArg_ParseTuple(args, "s", &s))
        return NULL;
    if (!hextolfp(s+2, &ts)) {
        PyErr_SetString(PyExc_ValueError, "ill-formed hex date");
        return NULL;

Isn't that as simple as convert a 64 bit integer to float and divide by 1<<32 
to get the right scale?





-- 
These are my opinions.  I hate spam.





More information about the devel mailing list