> For Python 3 I hope we (you) can consider another line of > flexibility too: sometimes when I build a hash table, I want an > __eq__ that isn't "the natural" __eq__ for the key objects. For > example, using a dict to partition objects by equivalence class > wants to use the equivalence relation of interest at the moment. > This implies a specific dict may want to use a "non-standard" > __hash__ too. Hiding the real objects in wrapper objects works for > this purpose, of course, but sometimes it would be a lot more > convenient to pass hash and eq functions to a dict's constructor. Couldn't you write a dict-like class that does the wrapping for you? I'm worried that adding such flexibility to dict will slow down the common case. --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4