]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Update `TZDateTime` type decorator example to align with python docs
authorKevin Kirsche <kevin.kirsche@one.verizon.com>
Mon, 4 Dec 2023 18:25:24 +0000 (13:25 -0500)
committerFederico Caselli <cfederico87@gmail.com>
Wed, 6 Dec 2023 22:01:12 +0000 (23:01 +0100)
commit8b2bf92f223c9036fee84e127f0eaf9573a9c2ee
tree312961a4942a0ea4737d15cc9dc1db2e92170a10
parent6cc22338bf68b8997b48e28a58c280c9c25bcddf
Update `TZDateTime` type decorator example to align with python docs

This change updates the `TZDateTime` type decorator to use the timezone awareness checks described in the Python documentation located here:

https://docs.python.org/3/library/datetime.html#determining-if-an-object-is-aware-or-naive

The specific lines state:

> A [`datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime) object `d` is aware if both of the following hold:
>
> `d.tzinfo is not None`
>
> `d.tzinfo.utcoffset(d)` does not return `None`
>
> Otherwise, `d` is naive.

Closes: #10719
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/10719
Pull-request-sha: bb30cb3cfe57f326addec21a6cae5f81184c2e74

Change-Id: I1ac51c1ec2820c3f224a79b7af5057fe2b3a55e2
(cherry picked from commit e1477c152c5a1e097399300883fcd6b23a6dfabf)
doc/build/core/custom_types.rst