
Oct. 31, 2019
6:22 a.m.
On Wed, Oct 30, 2019 at 11:55 PM Oz Tiram <oz.tiram@gmail.com> wrote:
Hi Steve,
Thanks for your reply. While dataclass provide a cleaner API than DictRow (you can access `row.id` instead of `row["id"]`). However, dataclass still use the built in `__dict__` instead of `__slots__`.
This means that the users reading large files won't see the suggested memory improvements.
FWIW, there is memory improvements thanks to the Key-sharing dictionary. See PEP 412 [1]. I have an idea about utilizing Key-sharing dictionary in DictReader, but I have not implemented it yet. [1]: https://www.python.org/dev/peps/pep-0412/