Daniel Cer wrote:
Why not just inherit from dict? That seems to work.

Because that isn't the question - Steven knows how to make it work, what he's curious about is why things are the way they are :)


Anyway, a quick look suggests that it is due to typeobject.c using the concrete PyDict_* API calls [1] to manipulate tp_dict, rather than the abstract PyMapping_* calls [2]. The reason behind using the concrete API is, presumably, a question of speed :)

Cheers,
Nick.

[1] http://www.python.org/dev/doc/devel/api/dictObjects.html
[2] http://www.python.org/dev/doc/devel/api/mapping.html
--
Nick Coghlan   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---------------------------------------------------------------
            http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to