-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
gh-118469: Add documentation for sqlite3 PEP-249 constructors #122091
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Hi, I was looking at #118469. The original PR hasn't been updated for awhile, so incorporated the feedback on that PR here. |
Ok, so let's add a |
Co-authered-by: Firat <firatv@protonmail.com>
.. function:: DateFromTicks(ticks) | ||
|
||
This function constructs an object holding a date value from the given ticks | ||
value (number of seconds since the epoch; see the documentation of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume it's the UNIX epoch and not Gregorian epoch? Can it be a fractional number of seconds or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume it's the UNIX epoch and not Gregorian epoch?
Yeah the UNIX epoch.
Can it be a fractional number of seconds or not?
This was taken from PEP-249. Should we get clarification there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it was not considered at that time. In general, we don't change PEPs (unless there is a real issue with the PEP I think, but I am not aware of a precedent). Best is to ask @erlend-aasland: should we leave it imprecise, or is there some assumptions that I'm not aware of?
|
||
This function constructs an object holding a time value. | ||
|
||
.. function:: Timestamp(year, month, day, hour, minute, second) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the second allowed to be fractional or not? (same question for Time()
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my tests, Doing something like this fails:
sqlite3.Time(12, 30, 45.12)
But this succeeds:
sqlite3.Time(12, 30, 45, 12)
However, it is not mentioned in PEP-249. How should we handle that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh. I think should definitely be documented and the signature of Time
should be something like Time(h, m, s[, ms])
(check the syntax in the time module, I don't remember now).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha. Re-reading the issue, I believe the intention was to document these constructors per PEP-249. I'm not sure if this is more an implementation detail. Will wait for @erlend-aasland guidance.
Thanks @erlend-aasland . I added the co-author-by trailer to the commit. |
📚 Documentation preview 📚: https://cpython-previews--122091.org.readthedocs.build/