[issue35889] sqlite3.Row doesn't have useful repr

2021-05-19 Thread Berker Peksag
Berker Peksag added the comment: Let's close it as rejected. Thank you everyone for your input. -- resolution: -> rejected stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue35889] sqlite3.Row doesn't have useful repr

2021-05-18 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: See: - https://www.sqlite.org/c3ref/column_database_name.html - https://www.sqlite.org/c3ref/table_column_metadata.html Notice that the former is only available if SQLITE_ENABLE_COLUMN_METADATA was defined at compile time. --

[issue35889] sqlite3.Row doesn't have useful repr

2021-05-18 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: > What about a __repr__ that includes the primary key value(s) (for tables > where that is defined)? I’d rather have that as a Row method, or read-only property. It should be straight-forward to implement. SQLite provides an API for such purposes.

[issue35889] sqlite3.Row doesn't have useful repr

2021-05-17 Thread Catherine Devlin
Catherine Devlin added the comment: What about a __repr__ that includes the primary key value(s) (for tables where that is defined)? That would be useful and informative, and also generally short. -- nosy: +Catherine.Devlin ___ Python tracker

[issue35889] sqlite3.Row doesn't have useful repr

2021-04-08 Thread Erlend Egeberg Aasland
Erlend Egeberg Aasland added the comment: Suggesting to either close this or add an example to the docs. Up to Berker / Serhiy. -- Added file: https://bugs.python.org/file49942/patch.diff ___ Python tracker

[issue35889] sqlite3.Row doesn't have useful repr

2021-04-08 Thread Erlend Egeberg Aasland
Erlend Egeberg Aasland added the comment: Even better, let's keep Row as it is and just add this as an example in the docs. If a verbose repr is needed, it's easy to override __repr__. -- ___ Python tracker

[issue35889] sqlite3.Row doesn't have useful repr

2021-04-08 Thread Erlend Egeberg Aasland
Erlend Egeberg Aasland added the comment: AFAICS, this is fixed by the attached one-liner, based on Serhiy's suggestion (based on Raymond's suggestion). $ python3.10 test.py $ ./python.exe test.py # patch applied $ cat test.py import sqlite3 cx = sqlite3.connect(":memory:")

[issue35889] sqlite3.Row doesn't have useful repr

2019-08-29 Thread Vlad Shcherbina
Vlad Shcherbina added the comment: 1. "This patch adds too many lines of code and not enough value." If the maintainers judge it so, I have nothing to say. You have the responsibility to keep the codebase relatively simple. 2a. "Existing programs made with the assumption that repr(row) is

[issue35889] sqlite3.Row doesn't have useful repr

2019-08-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: If this goes forward, the maximum output size needs to be limited in some way (like what is done in reprlib). Given Serhiy's doubts, I'm only +0 on this. Feel free to close this if you like. For the most part, I don't think people even look at Row

[issue35889] sqlite3.Row doesn't have useful repr

2019-03-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I have the same doubts as Berker. sqlite3.Row represents a data from a database. Databases are used in particularly for storing a large amount of data which can not be all loaded in RAM. Therefore sqlite3.Row can contain a data with a very long repr. If

[issue35889] sqlite3.Row doesn't have useful repr

2019-02-22 Thread Vlad Shcherbina
Vlad Shcherbina added the comment: There is no need to add explicit knowledge of reprlib to the Row object or vice versa. Those who use reprlib to limit output size will have no problem. Reprlib already truncates arbitrary reprs at the string level:

[issue35889] sqlite3.Row doesn't have useful repr

2019-02-14 Thread Berker Peksag
Change by Berker Peksag : -- pull_requests: -11844 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35889] sqlite3.Row doesn't have useful repr

2019-02-14 Thread Berker Peksag
Change by Berker Peksag : -- pull_requests: -11845 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35889] sqlite3.Row doesn't have useful repr

2019-02-14 Thread Berker Peksag
Berker Peksag added the comment: While the proposed formats look nice for artificial inputs, the Row object can have more than two fields and the value of a field can be much longer than that. So, in practice the new repr can make the situation worse than the current repr. I think wrapping

[issue35889] sqlite3.Row doesn't have useful repr

2019-02-14 Thread Berker Peksag
Change by Berker Peksag : -- pull_requests: -11846 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35889] sqlite3.Row doesn't have useful repr

2019-02-11 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch, patch, patch, patch pull_requests: +11844, 11845, 11846, 11847 stage: -> patch review ___ Python tracker ___

[issue35889] sqlite3.Row doesn't have useful repr

2019-02-11 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch, patch pull_requests: +11844, 11845 stage: -> patch review ___ Python tracker ___

[issue35889] sqlite3.Row doesn't have useful repr

2019-02-11 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch pull_requests: +11844 stage: -> patch review ___ Python tracker ___ ___

[issue35889] sqlite3.Row doesn't have useful repr

2019-02-11 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch, patch, patch pull_requests: +11844, 11845, 11847 stage: -> patch review ___ Python tracker ___

[issue35889] sqlite3.Row doesn't have useful repr

2019-02-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: +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): >>>

[issue35889] sqlite3.Row doesn't have useful repr

2019-02-08 Thread Terry J. Reedy
Terry J. Reedy added the comment: Enhancements only go into future versions. This would have the same pluses and minuses as printing dicts in full. I don't know the general feeling about expanding the classes printed out like this, or whether Gerhard is still active. If you don't get

[issue35889] sqlite3.Row doesn't have useful repr

2019-02-02 Thread Vlad Shcherbina
New submission from Vlad Shcherbina : To reproduce, run the following program: import sqlite3 conn = sqlite3.connect(':memory:') conn.row_factory = sqlite3.Row print(conn.execute("SELECT 'John' AS name, 42 AS salary").fetchone()) It prints ''. It would be nice if it printed something like