On Tue, Sep 15, 2020 at 5:08 AM Marco Sulla <[email protected]> wrote: > > 1. How can we check the size of an object only if it's an iterable > using the Python C API?
There is no good way. Additionally, we need to know distinct count if we want to preallocate hash table. For example, `len(dict(["foo"]*1000))` is 1, not 1000. > 2. Why, in your opinion, no relevant speedup was done? > We have "one big resize" logic in dict_merge already. And I use dummy empty dictkeys for new empty dict. So we don't allocate any temporary, intermediate dictkey object. Bests, -- Inada Naoki <[email protected]> _______________________________________________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/DT3VMOMUJG7R7V2RLVRXJZAFXEPKLBKA/ Code of Conduct: http://python.org/psf/codeofconduct/
