[Python-checkins] r76733 - python/trunk/Objects/abstract.c

Benjamin Peterson benjamin at python.org
Thu Dec 10 19:37:35 CET 2009


2009/12/10 Guido van Rossum <guido at python.org>:
> On Thu, Dec 10, 2009 at 4:45 AM, Benjamin Peterson <benjamin at python.org> wrote:
>> 2009/12/9 Brett Cannon <brett at python.org>:
>>> Why the change? This tie into abc stuff somehow?
>>
>> No, it's clearer (where else is PyObject_IsInstance(x, PyDict_Type) in
>> the source?), and avoids the problem of having isinstance fail.
>
> Yeah, but it is a semantic change, since objects that "virtually"
> inherit from dict (by overriding __instancecheck__) will now be
> treated differently. Though I'm not sure if it matters -- that
> requires more research than I have time for right now.

I believe the intention of the original commit (r54662) predates ABCs,
so checking for a strict dictionary subclass is what is needed.



-- 
Regards,
Benjamin


More information about the Python-checkins mailing list