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

Conversation

SmartManoj
Copy link

@SmartManojSmartManoj commentedApr 30, 2022
edited
Loading

Adds nanosecond as a keyword argument for backward compatibility

Solves:#59648

robsdedude reacted with rocket emojisaulshanabrook and robsdedude reacted with eyes emoji
@bedevere-bot
Copy link

Every change to Pythonrequires a NEWS entry.

Please, add it using theblurb_it Web app or theblurb command-line tool.

Copy link
Contributor

@MojoVampireMojoVampire left a comment
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Summary:

  1. Don't apply automatic style fixes; it bloats the patch and makes it much harder to review
  2. UsingDecimal the way you're using it is inherently unsafe due to unknown contextual precision, and will make the code slower to boot. Find a way to do your work withint when usingfloat becomes impossible. Bonus: It won't make importingdatetime force you to loadDecimal in the process (a relatively heavyweight module)
  3. Several comparison and hash functions aren't using the submicrosecond data, so the extra data gets ignored, which seems like a problem.
  4. You broke pickling. Please don't do that.
  5. (A biggy I couldn't comment on inline) This only changes the Python leveldatetime module, that CPython itself doesn't even use, by and large. Any change to the Python level code indatetime.py requires a complementary change in_datetimemodule.c so the C accelerated version of the module has the same behavior (you may have avoided at least a few test failures because they were testing the C module and didn't notice the broken code in the Python module)

@rhettinger
Copy link
Contributor

This API looks reasonable to me.@tim-one What do you think?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@FlorianLudwigFlorianLudwigAwaiting requested review from FlorianLudwig

@MojoVampireMojoVampireAwaiting requested review from MojoVampire

@FichteFollFichteFollAwaiting requested review from FichteFoll

@pgansslepganssleAwaiting requested review from pgansslepganssle is a code owner

@abalkinabalkinAwaiting requested review from abalkinabalkin is a code owner

@StanFromIrelandStanFromIrelandAwaiting requested review from StanFromIreland

Assignees

@tim-onetim-one

Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

9 participants
@SmartManoj@bedevere-bot@rhettinger@StanFromIreland@pganssle@FlorianLudwig@FichteFoll@MojoVampire@tim-one

[8]ページ先頭

©2009-2025 Movatter.jp