[issue15443] datetime module has no support for nanoseconds

2021-04-29 Thread mdcb


mdcb  added the comment:

In the confines of PTP / IEEE1588, it's actually quite common and can be 
useful. It's not so much the ns, but the <1us that is missing.

--

___
Python tracker 
<https://bugs.python.org/issue15443>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15443] datetime module has no support for nanoseconds

2021-04-07 Thread mdcb


mdcb  added the comment:

This brings me back some times. Sorry if I am not up to date, the issue as I 
recall from back then was there wasn't even microseconds.
In telemetry, you can often have these kind time stamped measurements, it's not 
insignificant noise nobody cares about.

--

___
Python tracker 
<https://bugs.python.org/issue15443>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24511] Add methods for async protocols

2016-05-24 Thread mdcb

Changes by mdcb <mdcb...@gmail.com>:


--
nosy: +mdcb...@gmail.com

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24511>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24510] Make _PyCoro_GetAwaitableIter a public API

2016-05-24 Thread mdcb

Changes by mdcb <mdcb...@gmail.com>:


--
nosy: +mdcb...@gmail.com

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24510>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15443] datetime module has no support for nanoseconds

2015-04-08 Thread mdcb

mdcb added the comment:

Alexander,

The initial patch is indeed minimal. If it gains momentum and some level of 
acceptation, I'd be happy to do more amends and fixes as needed and recommended.

As for 2.7.9 - I'm not sure it makes much sense going PyPI patch if it's not 
going to happen on 3.x?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15443
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15443] datetime module has no support for nanoseconds

2015-03-10 Thread mdcb

mdcb added the comment:

Intention of the patch was to keep it simple and limited to nanoseconds (per 
the report).

Throwing in Decimal would work (and possibly bring further precision) but 
consider:

datetime.fromnanoseconds(ns)

vs

datetime.fromtimestamp(Decimal(ts))

I find the former cleaner - sure, it adds a new class method.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15443
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15443] datetime module has no support for nanoseconds

2015-03-10 Thread mdcb

mdcb added the comment:

backward compatibility is implemented as 'new python can load old pickle'. 
isn't it what backward compatible means?

The payload changed from 10 to 12 bytes to accomodate the nanoseconds, I don't 
know how to handle reverse-backward compatibility or if it's really needed.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15443
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15443] datetime module has no support for nanoseconds

2014-12-19 Thread mdcb

mdcb added the comment:

patch in attachment is an attempt to provide the datetime type nanosecond 
support, handles pickle versioning, expose a new class method 
datetime.fromnanoseconds

--
keywords: +patch
nosy: +mdcb...@gmail.com
Added file: http://bugs.python.org/file37509/datetime.nanosecond.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15443
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15443] datetime module has no support for nanoseconds

2014-12-19 Thread mdcb

Changes by mdcb mdcb...@gmail.com:


___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15443
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15443] datetime module has no support for nanoseconds

2014-12-19 Thread mdcb

mdcb added the comment:

minor bug fixes and improvements in new attachment.

--
Added file: http://bugs.python.org/file37512/datetime.nanosecond.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15443
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23084] nanosecond support

2014-12-18 Thread mdcb

New submission from mdcb:

nanosecond support has been discussed at length on python-dev and issue 15443.
POSIX.1b defines a struct timespec that is commonly used in C, and seems a good 
candidate to add core nanosecond support. kernel's time-related structs 
typically end up in the time module.

Attached patch defines a new type struct_timespec for the time module. A new 
capsule exports the type along with to/from converters - opening a bridge for 
C, and for example the datetime module.

--
components: Library (Lib)
files: time.struct_timespec.patch
hgrepos: 289
keywords: patch
messages: 232889
nosy: mdcb...@gmail.com
priority: normal
severity: normal
status: open
title: nanosecond support
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file37495/time.struct_timespec.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23084
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23084] nanosecond support

2014-12-18 Thread mdcb

Changes by mdcb mdcb...@gmail.com:


--
hgrepos:  -289

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23084
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23084] Expose C struct timespec (nanosecond resolution) in time module

2014-12-18 Thread mdcb

mdcb added the comment:

I'm going to be my own devil's advocate:

PyLong_FromLong

...

Thanks for all the links, I hadn't realized there was so much background to the 
issue, there is some good reading there too.
you've changed the title now, but in fact the intention was the other aspect, 
core nanosecond support in python. I just happened to pick timespec because it 
does the job and is reasonably widespread.

reading all this, and threading lighlty, I was playing with

class timestamp(int): pass
  measure of time expressed as a number of nanoseconds

but that seems to loose the type information after doing arithmetics

x=timestamp(10)
y=timestamp(20)
type(x+y) gives int

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23084
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23084] Expose C struct timespec (nanosecond resolution) in time module

2014-12-18 Thread mdcb

mdcb added the comment:

can we change back the title because in fact, exposing struct timespec wasn't 
really the intention (but keep the patch if you want it!)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23084
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23084] Expose C struct timespec (nanosecond resolution) in time module

2014-12-18 Thread mdcb

mdcb added the comment:

I'm fine my patch doesn't resolve the nanosecond support, but that doesn't 
mean the issue is closed per say.

Ref. to PEP410 rejection and de facto standard seems a bit expeditive.

assuming it worked, this would somewhat be more agreeable ?

class timestamp(int): pass
  measure of time expressed as a number of nanoseconds

--
resolution: rejected - 
status: pending - open

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23084
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23084] Expose C struct timespec (nanosecond resolution) in time module

2014-12-18 Thread mdcb

mdcb added the comment:

firefox did something and changed some fields I did not intend to. I'm trying 
to undo that now.

--
resolution:  - rejected
status: open - pending

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23084
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23084] Expose C struct timespec (nanosecond resolution) in time module

2014-12-18 Thread mdcb

mdcb added the comment:

naively and coming from C, you have time_t to represent time so even though 
underneath it's typedef, it gives the casual user like me comfort (2038 not 
accounted). I don't know the details why struct timespec was chosen rather than 
nanoseconds as integer, and in fact would rather leave that worry to others. 
maybe a typdef PyTimeStamp would make the defacto you mention more obvious, and 
maybe class timestamp(int):pass in python that seems to bring even more meaning 
but I don't know how you map that in the C API.

more practically speaking: you're welcomed to close this issue since it's 
seeminly going nowhere.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23084
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com