A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2011-November/114344.html below:

[Python-Dev] PyDict_Get/SetItem and dict subclasses

[Python-Dev] PyDict_Get/SetItem and dict subclasses [Python-Dev] PyDict_Get/SetItem and dict subclassesVictor Stinner victor.stinner at haypocalc.com
Sat Nov 5 17:21:09 CET 2011
Hi,

PyDict_GetItem() and PyDict_SetItem() don't call __getitem__ and __setitem__ 
for dict subclasses. Is there a reason for that?

I found this surprising behaviour when I replaced a dict by a custom dict 
checking the key type on set. But my __setitem__ was not called because the 
function using the dict was implemented in C (and I didn't know that ;-)).

Victor
More information about the Python-Dev mailing list

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