[Python-checkins] r75051 - in python/branches/py3k: Lib/test/test_range.py Objects/rangeobject.c

Nick Coghlan ncoghlan at gmail.com
Fri Sep 25 13:19:38 CEST 2009


Mark Dickinson wrote:
> On Thu, Sep 24, 2009 at 9:45 PM, Nick Coghlan <ncoghlan at gmail.com> wrote:
>> mark.dickinson wrote:
>>>  range_contains(rangeobject *r, PyObject *ob) {
>>> -    if (PyLong_Check(ob)) {
>>> +    if (PyLong_CheckExact(ob) || PyBool_Check(ob)) {
>> Didn't you just create the same problem for yourself with subclasses of
>> bool?
> 
> I don't think so.  PyBool_CheckExact doesn't exist (as I was
> slightly surprised to learn).  PyBool_Check is already
> an exact check (judging from the source).

Ah, thought it might be something like that (although it also strikes me
as a bit of an odd quirk in the API).

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------


More information about the Python-checkins mailing list