Currently enum names are strings, but this is being changed to become
Literal. When this will happen, the type inferred will not be valid
anymore, as we mutate it and manipulate it as string in the function.
See https://github.com/python/mypy/pull/18797
parts = []
if pgconn.status == OK:
# Put together the [STATUS]
- status = TransactionStatus(pgconn.transaction_status).name
+ status: str = TransactionStatus(pgconn.transaction_status).name
if pgconn.pipeline_status:
status += f", pipeline={PipelineStatus(pgconn.pipeline_status).name}"