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

2014-12-19 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- components: +Extension Modules -Library (Lib) status: open -> closed ___ Python tracker ___ ___ P

[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 wo

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

2014-12-18 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: "nanosecond support [in Python]" is a PEP-size topic. As Victor suggested, "If you are motivated enough, you may update the PEP and write a new one." The tracker does not provide a sufficiently large forum to discuss "nanosecond support" in full genera

[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 __

[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

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

2014-12-18 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > can we change back the title because in fact Please don't. If you would like to discuss general ideas - the right forum would be the "python-ideas" mailing list. We have no shortage of issue numbers: once you have another specific proposal - feel fre

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

2014-12-18 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > but that seems to loose the type information after doing arithmetics Hear, hear. See #2267. If you find out why Python was designed this way - let me know. -- ___ Python tracker

[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 ___

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

2014-12-18 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > If I am reading data from an external device that has nanosecond > resolution, how would I create such a time stamp in Python right now? seconds * 10**9 + nanoseconds (translated to C API if necessary) -- __

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

2014-12-18 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[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

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

2014-12-18 Thread Ethan Furman
Ethan Furman added the comment: If I am reading data from an external device that has nanosecond resolution, how would I create such a time stamp in Python right now? -- ___ Python tracker

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

2014-12-18 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I would say that rejection note for PEP 410 [1] and the implementation of st_[amc]time_ns fields in os.stats() have established a de-facto standard for representing nanosecond resolution timestamps in Python. I think this proposal should be rejected. [1

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

2014-12-18 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- title: nanosecond support -> Expose C struct timespec (nanosecond resolution) in time module ___ Python tracker ___