classification
Title: Eliminate unnecessary check in _strptime when determining AM/PM
Type: Stage: patch review
Components: Library (Lib) Versions: Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: gphemsley, p-ganssle
Priority: normal Keywords: patch

Created on 2019-05-19 21:24 by gphemsley, last changed 2019-05-19 21:29 by gphemsley.

Pull Requests
URL Status Linked Edit
PR 13428 open gphemsley, 2019-05-19 21:28
Messages (1)
msg342872 - (view) Author: Gordon P. Hemsley (gphemsley) * Date: 2019-05-19 21:24
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.
History
Date User Action Args
2019-05-19 21:29:50gphemsleysetcomponents: + Library (Lib)
2019-05-19 21:28:01gphemsleysetkeywords: + patch
stage: patch review
pull_requests: + pull_request13338
2019-05-19 21:24:06gphemsleycreate