Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-59648: Nanosecond support for datetime#92078

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
SmartManoj wants to merge163 commits intopython:main
base:main
Choose a base branch
Loading
fromSmartManoj:patch-4
Open
Changes from1 commit
Commits
Show all changes
163 commits
Select commitHold shift + click to select a range
bcc712e
Nanosecond support for datetime
SmartManojApr 30, 2022
db8a9a5
📜🤖 Added by blurb_it.
blurb-it[bot]Apr 30, 2022
b559573
typo
SmartManojApr 30, 2022
e0e0ee9
removed Decimal
SmartManojMay 6, 2022
c0af7e9
updated probe1
SmartManojMay 6, 2022
1678928
updated utcnow
SmartManojMay 6, 2022
7f6b8b8
Merge branch 'main' into patch-4
SmartManojMay 6, 2022
8492efa
Merge branch 'main' into patch-4
SmartManojMay 20, 2022
37e77d8
nit
SmartManojJan 28, 2025
1b500e6
don't divide
SmartManojJan 28, 2025
049a7dd
Merge branch 'main' into pr/92078
SmartManojJan 28, 2025
3de498e
add nanosecond
SmartManojJan 28, 2025
b0c9552
update docstring
SmartManojJan 28, 2025
69bfcd8
truncate decimal
SmartManojJan 28, 2025
ef62206
rename to nanosecond
SmartManojJan 29, 2025
78d4188
parse empty string
SmartManojJan 29, 2025
b56c892
Merge branch 'main' into patch-4
SmartManojApr 17, 2025
e7305a4
fix kwarg
SmartManojApr 17, 2025
9d2f818
update logic
SmartManojApr 17, 2025
0986e7b
lint
SmartManojApr 17, 2025
e437eaf
Merge branch 'main' into pr/92078
SmartManojApr 17, 2025
be25162
Merge branch 'main' into patch-4
SmartManojApr 23, 2025
38c00d6
cleanup
SmartManojApr 24, 2025
e23588b
revert changes in __reduce__
SmartManojApr 24, 2025
bf71681
lint
SmartManojApr 24, 2025
dac7876
update time class
SmartManojApr 24, 2025
2b78414
update whatsnew
SmartManojApr 24, 2025
efb694f
Change name to English
SmartManojApr 24, 2025
e4ae66d
Remove Emoji
SmartManojApr 24, 2025
f5c118d
Merge branch 'main' into pr/92078
SmartManojApr 24, 2025
0b7a81b
update news
SmartManojApr 24, 2025
8189e88
update time_isoformat
SmartManojApr 24, 2025
10b69f7
update check_time_args
SmartManojApr 24, 2025
b0ebfc5
add nanosecond arg
SmartManojApr 24, 2025
adb92a6
Merge branch 'main' into pr/92078
SmartManojApr 25, 2025
54127a2
update timedelta
SmartManojApr 25, 2025
633ff23
add complimentary changes
SmartManojApr 25, 2025
6687799
Merge branch 'main' into pr/92078
SmartManojApr 25, 2025
4ca6185
add ns
SmartManojApr 25, 2025
0c4ff5a
Merge branch 'main' into pr/92078
SmartManojApr 25, 2025
f100451
lint
SmartManojApr 25, 2025
4f5f428
add macro
SmartManojApr 25, 2025
6a43121
Merge branch 'main' into pr/92078
SmartManojApr 25, 2025
9c23406
update doc
SmartManojApr 25, 2025
b125d71
declare delta_ns
SmartManojApr 25, 2025
911ddb0
fix constructors
SmartManojApr 25, 2025
c775e96
Merge branch 'main' into pr/92078
SmartManojApr 25, 2025
3590c7c
fix signature
SmartManojApr 26, 2025
c323ed5
Merge branch 'main' into pr/92078
SmartManojApr 26, 2025
d577bc3
fix clinic input
SmartManojApr 26, 2025
29c8112
fix get_datetime_fromdateandtime
SmartManojApr 26, 2025
13dcc7b
fix macro
SmartManojApr 26, 2025
26c8800
fix get_time_fromtime
SmartManojApr 26, 2025
b30edbc
force regenerate clinic output
SmartManojApr 26, 2025
aed1afa
add append_keyword_nanosecond
SmartManojApr 27, 2025
75553a2
fix tests
SmartManojApr 26, 2025
dad595d
Merge branch 'main' into pr/92078
SmartManojApr 27, 2025
6f4db2b
Merge branch 'main' into pr/92078
SmartManojApr 28, 2025
ebaf468
remove test_backdoor_resistance
SmartManojApr 28, 2025
00e3b45
minor fixes
SmartManojApr 28, 2025
f9d468c
update tests
SmartManojApr 28, 2025
4959a6a
Merge branch 'main' into pr/92078
SmartManojApr 28, 2025
eabd9a5
fix test
SmartManojApr 28, 2025
7d8183c
Merge branch 'main' into pr/92078
SmartManojApr 28, 2025
70320ca
bug fix
SmartManojApr 29, 2025
10ac2d6
temp
SmartManojApr 29, 2025
bda6c29
Merge branch 'main' into pr/92078
SmartManojApr 29, 2025
0bcf405
bug fix
SmartManojApr 30, 2025
17f2943
update test
SmartManojApr 30, 2025
2173886
temp
SmartManojApr 30, 2025
387baf9
Merge branch 'main' into pr/92078
SmartManojApr 30, 2025
56bc655
regen
SmartManojMay 1, 2025
92c53b2
temp
SmartManojMay 1, 2025
629fa5b
Merge branch 'main' into pr/92078
SmartManojMay 1, 2025
9b73fd6
add missing arg
SmartManojMay 1, 2025
4fefead
use const
SmartManojMay 1, 2025
28647b0
update value
SmartManojMay 1, 2025
bdb8385
temp
SmartManojMay 1, 2025
861e403
Update datetimetester.py
SmartManojMay 1, 2025
7fddf11
Update datetime.h
SmartManojMay 1, 2025
0b0b214
fix arg
SmartManojMay 1, 2025
c2ed07c
temp
SmartManojMay 1, 2025
bae2e30
Merge branch 'main' into pr/92078
SmartManojMay 1, 2025
98297a1
lint
SmartManojMay 1, 2025
8d80782
temp
SmartManojMay 1, 2025
216b66b
Merge branch 'main' into pr/92078
SmartManojMay 2, 2025
c6c1084
doc
SmartManojMay 2, 2025
1fa2290
fix arg
SmartManojMay 2, 2025
3d44712
temp
SmartManojMay 2, 2025
eec6945
fix order
SmartManojMay 2, 2025
243fc01
set ns
SmartManojMay 3, 2025
30ca5fb
Update datetimetester.py
SmartManojMay 3, 2025
e359e90
lint
SmartManojMay 3, 2025
18f5344
Update datetimetester.py
SmartManojMay 3, 2025
f6b3da8
fix call_subclass_fold
SmartManojMay 3, 2025
90f7f74
fix pickle
SmartManojMay 3, 2025
bc241f0
Update datetime.rst
SmartManojMay 3, 2025
ecaf671
update call_subclass_fold
SmartManojMay 3, 2025
9853682
Update _pydatetime.py
SmartManojMay 3, 2025
f114afc
lint
SmartManojMay 3, 2025
797dcc4
fix parse_hh_mm_ss_ff
SmartManojMay 4, 2025
274aaee
upd ops
SmartManojMay 4, 2025
52dff86
account floating microseconds
SmartManojMay 4, 2025
02adcd8
test pure only now
SmartManojMay 4, 2025
b6a5155
Merge branch 'main' into pr/92078
SmartManojMay 4, 2025
e1b192a
fix nanoseconds_to_delta
SmartManojMay 4, 2025
a3c165b
temp
SmartManojMay 4, 2025
840f3a8
fix time_repr
SmartManojMay 4, 2025
0e6db63
temp
SmartManojMay 4, 2025
c141c4a
temp
SmartManojMay 4, 2025
120ed24
update delta_total_seconds
SmartManojMay 11, 2025
132f84b
update delta_new
SmartManojMay 11, 2025
e462ac8
temp
SmartManojMay 11, 2025
069f6ae
Merge branch 'main' into pr/92078
SmartManojMay 11, 2025
15b5f25
remove unused var
SmartManojMay 11, 2025
6ef2801
temp
SmartManojMay 11, 2025
f3a4344
fix delta_getstate
SmartManojMay 11, 2025
7ad5b67
update test_extreme_timedelta
SmartManojMay 11, 2025
ad22865
revert delta_new changes
SmartManojMay 12, 2025
49605ae
temp
SmartManojMay 12, 2025
e7feec3
temp
SmartManojMay 12, 2025
16f821b
Merge branch 'main' into pr/92078
SmartManojMay 12, 2025
6a5c4f0
remove microseconds float check
SmartManojMay 12, 2025
436775e
Clarify microseconds handling after divmod operation
SmartManojMay 13, 2025
f8d3402
separate long numbers
SmartManojMay 13, 2025
ed876f2
update delta_new
SmartManojMay 13, 2025
4d3573a
temp
SmartManojMay 13, 2025
f208cd4
Merge branch 'main' into pr/92078
SmartManojMay 13, 2025
77c4865
temp
SmartManojMay 13, 2025
9750570
fix multiply_int_timedelta
SmartManojMay 13, 2025
4062a59
temp
SmartManojMay 14, 2025
45108a0
Merge branch 'main' into pr/92078
SmartManojMay 14, 2025
01f273a
temp
SmartManojMay 17, 2025
d3857b2
Merge branch 'main' into pr/92078
SmartManojMay 17, 2025
469e077
lint
SmartManojMay 17, 2025
17decdc
move tmp functions
SmartManojMay 17, 2025
fd92889
remove partial duplicated logic
SmartManojMay 17, 2025
632eabd
update nanoseconds_to_delta for large number
SmartManojMay 17, 2025
33f382f
handle -ve leftover_ns
SmartManojMay 17, 2025
eb6e479
comment zero_delta due to weird bug
SmartManojMay 17, 2025
1c374af
temp-
SmartManojMay 17, 2025
7638a54
fix test_microsecond_rounding
SmartManojMay 17, 2025
8609df2
Merge branch 'main' into pr/92078
SmartManojMay 17, 2025
16becbe
normalize
SmartManojMay 17, 2025
236a840
fix segmentation fault
SmartManojMay 17, 2025
52bd399
temp-
SmartManojMay 17, 2025
5c29759
lint
SmartManojMay 17, 2025
1bfcc9e
Merge branch 'main' into pr/92078
SmartManojMay 17, 2025
960ae24
typo
SmartManojMay 18, 2025
7ab1368
add overflow test
SmartManojMay 18, 2025
fe8403c
fix rounding
SmartManojMay 18, 2025
dc92ee8
fix segfault
SmartManojMay 18, 2025
02f9e2b
temp-
SmartManojMay 18, 2025
10b28c1
Merge branch 'main' into pr/92078
SmartManojMay 18, 2025
28b661c
round if it has decimal points
SmartManojMay 18, 2025
1aeb27e
update datatype for windows
SmartManojMay 18, 2025
9abd6af
Merge branch 'main' into pr/92078
SmartManojMay 18, 2025
ef51bb3
fix order
SmartManojMay 18, 2025
28fd687
remove space
SmartManojMay 18, 2025
52a4436
remove extra dot
SmartManojMay 18, 2025
31307d2
add pickle compatibility
SmartManojMay 18, 2025
5e5711f
fix pickling
SmartManojMay 18, 2025
c4c5e76
lint
SmartManojMay 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
lint
  • Loading branch information
@SmartManoj
SmartManoj committedMay 18, 2025
commitc4c5e76f901b479bd79843f389c30d7d7ecd62bb
8 changes: 4 additions & 4 deletionsModules/_datetimemodule.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3188,7 +3188,7 @@
if (ns) {
if (PyFloat_Check(ns)) {
double ns_val = PyFloat_AsDouble(ns);
leftover_ns += ns_val;

Check warning on line 3191 in Modules/_datetimemodule.c

View workflow job for this annotation

GitHub Actions/ Windows / Build and test (arm64)

'+=': conversion from 'double' to 'float', possible loss of data [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 3191 in Modules/_datetimemodule.c

View workflow job for this annotation

GitHub Actions/ Windows (free-threading) / Build and test (arm64)

'+=': conversion from 'double' to 'float', possible loss of data [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 3191 in Modules/_datetimemodule.c

View workflow job for this annotation

GitHub Actions/ Windows / Build and test (x64)

'+=': conversion from 'double' to 'float', possible loss of data [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 3191 in Modules/_datetimemodule.c

View workflow job for this annotation

GitHub Actions/ Windows (free-threading) / Build and test (x64)

'+=': conversion from 'double' to 'float', possible loss of data [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
} else {
leftover_ns += PyLong_AsLong(ns);
}
Expand All@@ -3196,7 +3196,7 @@
if (leftover_us) {
long integral_us = (long)leftover_us;
// TODO: should use py_round; previous rounding was also wrong as it checks for x_is_odd instead of x + whole_us
leftover_ns = round((leftover_us - integral_us) * 1000);

Check warning on line 3199 in Modules/_datetimemodule.c

View workflow job for this annotation

GitHub Actions/ Windows / Build and test (arm64)

'=': conversion from 'double' to 'float', possible loss of data [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 3199 in Modules/_datetimemodule.c

View workflow job for this annotation

GitHub Actions/ Windows (free-threading) / Build and test (arm64)

'=': conversion from 'double' to 'float', possible loss of data [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 3199 in Modules/_datetimemodule.c

View workflow job for this annotation

GitHub Actions/ Windows / Build and test (x64)

'=': conversion from 'double' to 'float', possible loss of data [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 3199 in Modules/_datetimemodule.c

View workflow job for this annotation

GitHub Actions/ Windows (free-threading) / Build and test (x64)

'=': conversion from 'double' to 'float', possible loss of data [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
if (leftover_ns > 999) {
integral_us++;
leftover_ns -= 1000;
Expand DownExpand Up@@ -4978,13 +4978,13 @@

/* Copy the data we have */
memcpy(me->data, pdata, data_size);

/* If we don't have nanoseconds in the pickled data, initialize them to 0 */
if (data_size == _PyDateTime_OLD_TIME_DATASIZE) {
me->data[6] = 0;
me->data[7] = 0;
}

me->hashcode = -1;
me->hastzinfo = aware;
if (aware) {
Expand DownExpand Up@@ -5741,13 +5741,13 @@

/* Copy the data we have */
memcpy(me->data, pdata, data_size);

/* If we don't have nanoseconds in the pickled data, initialize them to 0 */
if (data_size == _PyDateTime_OLD_DATETIME_DATASIZE) {
me->data[10] = 0;
me->data[11] = 0;
}

me->hashcode = -1;
me->hastzinfo = aware;
if (aware) {
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp