Skip to content

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dave-r12
Copy link

@dave-r12 dave-r12 commented Jul 21, 2024

@ghost
Copy link

ghost commented Jul 21, 2024

All commit authors signed the Contributor License Agreement.
CLA signed

@dave-r12
Copy link
Author

Hi, I was looking at #118469. The original PR hasn't been updated for awhile, so incorporated the feedback on that PR here.

@erlend-aasland
Copy link
Contributor

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> trailer to the commit.

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
Copy link
Member

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?

Copy link
Author

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?

Copy link
Member

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)
Copy link
Member

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())

Copy link
Author

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?

Copy link
Member

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).

Copy link
Author

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.

@dave-r12
Copy link
Author

Thanks @erlend-aasland . I added the co-author-by trailer to the commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review docs Documentation in the Doc dir skip news
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy