4 ms·
While it's nice to get a peek at the implementation details of CPython in this way, I doubt that dict(foo=bar, ...) is typically going to be part of a critical
by andreasvc 14y ago
While it's nice to get a peek at the implementation details of CPython in this way, I doubt that dict(foo=bar, ...) is typically going to be part of a critical inner loop. It's much more likely to be executed just once before a loop, making this finding irrelevant for real optimization problems.
- haeric 14y agoWhat are you using Python for? There are plenty of occations where I have made lists of dictionaries, e.g. when I have have large amounts of data that have to be outputted in a certain way, or if it's just logical to store dictionaries instead of instances of some custom class. No performance critical stuff though, and I've almost never used dict(), but still, calling this irrelevant for optimization is a bit harsh...