Description
Feature or enhancement
Proposal:
The ConfigParser class supports dictionary-like operations, including the contains protocol for checking section existence using the in operator. However, it lacks str and repr methods, essential for providing human-readable and developer-friendly representations of the configuration data. Adding these methods would enhance its usability, particularly for debugging, logging, and unit testing, by offering clear insights into its internal state.
current behavior:
str_resp: <configparser.ConfigParser object at 0x7f57e7cc5160>
repr_resp: <configparser.ConfigParser object at 0x7f57e7cc5160>
suggested behavior:
str_resp: {'GERRIT': {'api_key': 'val'}}
repr_resp: <ConfigParser: {'GERRIT': {'api_key': 'val'}}>
I haven’t started a thread on Python Discourse as this is a straightforward feature request requiring a simple accept or reject decision. I'd appreciate the clarification on whether there was a specific design reason for not including str and repr. If approved, I will raise a PR.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to the previous discussion of this feature:
No response