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.

Author rhettinger
Recipients ghaering, rhettinger, terry.reedy, vlad
Date 2019-02-11.02:30:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1549852205.41.0.72198454056.issue35889@roundup.psfhosted.org>
In-reply-to
Content
+1 from me.  We're already made regular expression match objects less opaque and that has been useful.  There's no need for a python-ideas discussion for this.

If a repr doesn't round-trip, we generally put it angle brackets (see PEP 8):

    >>> re.search(r'([a-z]+)(\d*)', 'alpha7')
    <re.Match object; span=(0, 6), match='alpha7'>

The Row object access style uses square brackets and has a keys() method.  That suggests a dict-like representation would be intuitive and match how Row objects are used:  ro['salary'] and ro.keys().

Putting those two ideas together we get:

    <sqlite3.Row object; {'name': 'John', 'salary': 42}>

Note the OP's suggestion for keyword argument style doesn't make sense for two reasons: 1) Row objects don't allow attribute access (i.e. ro.name is invalid) and 2) the field names are not required to be valid Python identifiers (i.e. ro['class'] is possible but ro.class is syntactically invalid because "class" is a keyword).
History
Date User Action Args
2019-02-11 02:30:07rhettingersetrecipients: + rhettinger, terry.reedy, ghaering, vlad
2019-02-11 02:30:05rhettingersetmessageid: <1549852205.41.0.72198454056.issue35889@roundup.psfhosted.org>
2019-02-11 02:30:05rhettingerlinkissue35889 messages
2019-02-11 02:30:05rhettingercreate