You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it would help to clarify in the documentation that a deserialized datetime object is by default aware (i.e. its tzinfo attribute is set to a timezone object provided by the pytz non-standard library) rather than being naive (i.e. its tzinfo attribute is None).
In this context, normalizing while deserializing an awaredatetime into a naive datetime would be useful for those applications which operate purely on naivedatetime objects. For example, deserializing a string with +00:00 as a timezone might simply strip tzinfo, whereas other offsets ought to be added to a naivedatetime using a timedelta derived from the offset.
The text was updated successfully, but these errors were encountered:
@jenstroeger Hmm, the current docs seem to me to make it clear that naive datetimes get a timezone applied using the default_tzinfo attribute. Users who want to suppress that conversion need to pass tz_info=None when constructing the schema node / type. E.g.:
I think it would help to clarify in the documentation that a deserialized
datetime
object is by default aware (i.e. itstzinfo
attribute is set to a timezone object provided by thepytz
non-standard library) rather than being naive (i.e. itstzinfo
attribute isNone
).In this context, normalizing while deserializing an aware
datetime
into a naive datetime would be useful for those applications which operate purely on naivedatetime
objects. For example, deserializing a string with+00:00
as a timezone might simply striptzinfo
, whereas other offsets ought to be added to a naivedatetime
using atimedelta
derived from the offset.The text was updated successfully, but these errors were encountered: