Sam Kagan <ska...@nrao.edu> added the comment:

I encountered this issue in Python 3.8. I consider it to be a bug because it's 
an instance of a class-defined constant (datetime.min) not working with a 
method of that class (timestamp) when all other values that the class could 
take work with the method AND the constant works with all of the class' other 
methods. And it has practical implications: As belopolsky said above, "a 
reasonable design can use datetime.min/max as placeholders for unknown times 
far in the past/future compensating for the lack [of] datetime ±inf."

Since datetime.min lies so close to the edges of datetime's value-space, 
perhaps it should be made offset-aware and placed in UTC so that it stops 
breaking timestamp() when the user is in the wrong timezone. Alternatively, 
there could be a note in the documentation for datetime.timestamp() about this 
edge case. Assuming similarly bizarre behavior happens at datetime.max for one 
or more datetime methods (and for consistency's sake), it should probably be 
put in UTC as well.

----------
nosy: +skagan_NRAO
versions: +Python 3.8 -Python 3.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue31212>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to