New submission from Gordon P. Hemsley <gphems...@gphemsley.org>:

Since __calc_am_pm() explicitly limits self.am_pm to 2 values, there are only 
ever 3 possible values of %p: AM, PM, or blank. Since blank is treated the same 
as AM, there is only the need to check whether %p is PM. This eliminates an 
unnecessary comparison and doubly ensures that there is no unhandled case.

----------
messages: 342872
nosy: gphemsley, p-ganssle
priority: normal
severity: normal
status: open
title: Eliminate unnecessary check in _strptime when determining AM/PM
versions: Python 3.8

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

Reply via email to