This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: datetime datetime.time to datetime.time comparison does nothing
Type: behavior Stage: resolved
Components: Extension Modules Versions: Python 3.5
process
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: Nosy List: SilentGhost, belopolsky, jason crockett
Priority: normal Keywords:

Created on 2016-03-19 07:48 by jason crockett, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg262027 - (view) Author: jason crockett (jason crockett) Date: 2016-03-19 07:48
if datetime.time(#blah) > datetime.time(#blah):
      [a]                        [b]

does nothing.. it doesnt raise an error. it doesnt run the if function even though the printout of variables compared says it should.

22:15:00 [a]
16:00:00 [b]
True
22:20:00
16:00:00
True
22:25:00
16:00:00
msg262122 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2016-03-21 12:42
Jason, could you provide an actual paste of interactive interpreter session, so that any one could try to reproduce the issue.
msg262448 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2016-03-25 18:14
Python 3.6.0a0 (default:245a16f33c4b, Mar 25 2016, 14:11:43)
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>> if datetime.time(22, 15) > datetime.time(16, 0):
...     print('works for me')
...
works for me
History
Date User Action Args
2022-04-11 14:58:28adminsetgithub: 70778
2016-03-25 18:14:08belopolskysetstatus: open -> closed
resolution: works for me
messages: + msg262448

stage: test needed -> resolved
2016-03-23 19:29:32belopolskysetnosy: + belopolsky
2016-03-21 12:42:53SilentGhostsetnosy: + SilentGhost
messages: + msg262122

type: behavior
stage: test needed
2016-03-19 07:48:40jason crockettcreate