Dan Schult <dsch...@colgate.edu> added the comment:

Thank you... I stand corrected....
That's actually very helpful!

Of course using defdict makes the default assignment take two hashes,  
two lookups, an attribute/function lookup (__missing__) and the extra  
function call, plus doesn't allow arguments to the object factory...  
but it means that there is a hook into the dict API that allows us to  
create something when GetItem/subscript gives a KeyError...  I  
understand much more what I should be doing and where to look for it.

Thanks very much!

I still would prefer that the C-API allow PyDict_SetItem to be called  
without a hash or lookup.  Maybe a method called PyDict_SetEntry().   
But I haven't really looked at it, don't have a patch and am not sure  
if it is worth it.  I am willing to spend time doing looking into  
that kind of thing if you think that might be helpful.  Otherwise I  
will put it on my list of fun-projects-for-hazy-summer-weekends and  
get to it when I get to it.

Dan

----------

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

Reply via email to