Add boolean attribute to datetime objects stating if they are tz-aware

Currently the datetime docs say:
https://docs.python.org/3/library/datetime.html#available-types
Would an issue/PR be welcome to encode that logic into code? The docs could then read:
Nick

On Aug 27, 2019, at 10:38, Nick Timkovich <prometheus235@gmail.com> wrote:
Would this be a normal attribute that you always set at construction time? (Does that cause performance problems for aware datetime objects that never check the awareness?) Or is it a property that’s computed on the fly? If the latter, why a property rather than a method? What happens if utcoffset raises NotImplementedError? (Or anything else, I suppose, but NotImplementedError is the documented behavior for the base class.) Should date get an attribute that’s always False, or is it sufficiently obvious to most people that dates are always naive?

On Aug 27, 2019, at 10:38, Nick Timkovich <prometheus235@gmail.com> wrote:
Would this be a normal attribute that you always set at construction time? (Does that cause performance problems for aware datetime objects that never check the awareness?) Or is it a property that’s computed on the fly? If the latter, why a property rather than a method? What happens if utcoffset raises NotImplementedError? (Or anything else, I suppose, but NotImplementedError is the documented behavior for the base class.) Should date get an attribute that’s always False, or is it sufficiently obvious to most people that dates are always naive?
participants (2)
-
Andrew Barnert
-
Nick Timkovich