Lines Matching refs:ob
338 range_contains_long(rangeobject *r, PyObject *ob) in range_contains_long() argument
351 cmp2 = PyObject_RichCompareBool(r->start, ob, Py_LE); in range_contains_long()
352 cmp3 = PyObject_RichCompareBool(ob, r->stop, Py_LT); in range_contains_long()
355 cmp2 = PyObject_RichCompareBool(ob, r->start, Py_LE); in range_contains_long()
356 cmp3 = PyObject_RichCompareBool(r->stop, ob, Py_LT); in range_contains_long()
367 tmp1 = PyNumber_Subtract(ob, r->start); in range_contains_long()
382 range_contains(rangeobject *r, PyObject *ob) in range_contains() argument
384 if (PyLong_CheckExact(ob) || PyBool_Check(ob)) in range_contains()
385 return range_contains_long(r, ob); in range_contains()
387 return (int)_PySequence_IterSearch((PyObject*)r, ob, in range_contains()
513 range_count(rangeobject *r, PyObject *ob) in range_count() argument
515 if (PyLong_CheckExact(ob) || PyBool_Check(ob)) { in range_count()
516 int result = range_contains_long(r, ob); in range_count()
522 count = _PySequence_IterSearch((PyObject*)r, ob, PY_ITERSEARCH_COUNT); in range_count()
530 range_index(rangeobject *r, PyObject *ob) in range_index() argument
534 if (!PyLong_CheckExact(ob) && !PyBool_Check(ob)) { in range_index()
536 index = _PySequence_IterSearch((PyObject*)r, ob, PY_ITERSEARCH_INDEX); in range_index()
542 contains = range_contains_long(r, ob); in range_index()
547 PyObject *idx, *tmp = PyNumber_Subtract(ob, r->start); in range_index()
557 PyErr_Format(PyExc_ValueError, "%R is not in range", ob); in range_index()