Josh Rosenberg added the comment:

Not sure how much that really helps. If I understand you correctly, it would be 
a memory optimization that would require a round of rehashing to use?

If you wanted to make a change that got "guaranteed" better performance, you 
might add support for dict's dict_keys and dict_items objects (since those have 
the same uniqueness guarantees as a set or dict, and I could easily see someone 
creating sets from them to remove the link to the original dict).

If you wanted to get crazy, you might add preallocation support for 
collections.abc abstract classes equivalent to the built-ins, specifically, 
Set, Mapping, KeysView and ItemsView. That's probably not a good idea though, 
since it ends up calling out to Python code more (slowing you down for the 
general case) and it's probably not as safe, since a user-defined 
implementation of those abstract classes might not strictly adhere to the same 
uniqueness or hashability contracts the built-ins provide.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21507>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to