[issue33651] Add get() method to sqlite3.Row class

2018-05-26 Thread Raymond Hettinger
Raymond Hettinger added the comment: > But I hear Raymond's point about all field being known, > and I think that's a good point… and I agree I don't > actually need .get(). > Feel free to close. Thanks for the quick replies. Okay, done. -- resolution: -> rejected stage: -> resolv

[issue33651] Add get() method to sqlite3.Row class

2018-05-26 Thread Wilfredo Sanchez
Wilfredo Sanchez added the comment: Well, sequence and mapping are not mutually exclusive, and sqlite3.Row does allow mapping-style indexing, which is why I expected .get() to work. But I hear Raymond's point about all field being known, and I think that's a good point… and I agree I don't ac

[issue33651] Add get() method to sqlite3.Row class

2018-05-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I have the same question. Do you have a concrete example where this can be useful? sqlite3.Row is not a mapping. It is a sequence. >>> import sqlite3 >>> import collections.abc >>> issubclass(sqlite3.Row, collections.abc.Sequence) True -- nosy: +se

[issue33651] Add get() method to sqlite3.Row class

2018-05-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: How is this needed? SQL queries return rows that are homogenous and with known fields. This is isn't like other dictionaries when you might not know in advance whether a given key is present. -- nosy: +rhettinger

[issue33651] Add get() method to sqlite3.Row class

2018-05-25 Thread Wilfredo Sanchez
New submission from Wilfredo Sanchez : The sqlite3.Row class has mapping-like behavior but does not implement the get() method, so providing default values in code requires a bit of boilerplate that is not necessary with dictionaries. -- components: Library (Lib) messages: 317719 nosy: