Hi,

I created the following issue to expose the dictproxy as a builtin type.
http://bugs.python.org/issue14386

I would be interesting to accept any mapping type, not only dict.
dictproxy implementation supports any mapping, even list or tuple, but
I don't want to support sequences because a missing key would raise an
IndexError instead of a KeyError.

My problem is to check the type in C. issubclass(collections.ChainMap,
collections.abc.Sequence) is False which is the expected result, so I
need to implement this check in C. "The "PyMapping_Check(dict) &&
!PyMapping_Check(dict)" fails on ChainMap: type.__new__(ChainMap)
fills tp_as_sequence->sq_item slot is defined because ChainMap has a
__getitem__ method.

Do you have an idea how to implement such test?

Victor
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to