diff options
author | Benjamin Peterson <benjamin@python.org> | 2010-11-20 22:35:41 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2010-11-20 22:35:41 (GMT) |
commit | 0b458d52f9c58f0a47ea448e2349704fd33a7fe3 (patch) | |
tree | f39a5ecfd620ce0df8b8854e91e3dcb6d03c75d6 /Objects | |
parent | 2e579f0a87cdc196eb3df2ccdf8d85b628793637 (diff) | |
download | cpython-0b458d52f9c58f0a47ea448e2349704fd33a7fe3.zip cpython-0b458d52f9c58f0a47ea448e2349704fd33a7fe3.tar.gz cpython-0b458d52f9c58f0a47ea448e2349704fd33a7fe3.tar.bz2 |
count() should return integers #10474
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/rangeobject.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c index 9650386..2188dfb 100644 --- a/Objects/rangeobject.c +++ b/Objects/rangeobject.c @@ -338,9 +338,9 @@ range_count(rangeobject *r, PyObject *ob) { if (PyLong_CheckExact(ob) || PyBool_Check(ob)) { if (range_contains_long(r, ob)) - Py_RETURN_TRUE; + return PyLong_FromLong(1); else - Py_RETURN_FALSE; + return PyLong_FromLong(0); } else { Py_ssize_t count; count = _PySequence_IterSearch((PyObject*)r, ob, PY_ITERSEARCH_COUNT); |