Lines Matching refs:ob
383 range_contains_long(rangeobject *r, PyObject *ob) in range_contains_long() argument
397 cmp2 = PyObject_RichCompareBool(r->start, ob, Py_LE); in range_contains_long()
398 cmp3 = PyObject_RichCompareBool(ob, r->stop, Py_LT); in range_contains_long()
401 cmp2 = PyObject_RichCompareBool(ob, r->start, Py_LE); in range_contains_long()
402 cmp3 = PyObject_RichCompareBool(r->stop, ob, Py_LT); in range_contains_long()
413 tmp1 = PyNumber_Subtract(ob, r->start); in range_contains_long()
428 range_contains(rangeobject *r, PyObject *ob) in range_contains() argument
430 if (PyLong_CheckExact(ob) || PyBool_Check(ob)) in range_contains()
431 return range_contains_long(r, ob); in range_contains()
433 return (int)_PySequence_IterSearch((PyObject*)r, ob, in range_contains()
559 range_count(rangeobject *r, PyObject *ob) in range_count() argument
561 if (PyLong_CheckExact(ob) || PyBool_Check(ob)) { in range_count()
562 int result = range_contains_long(r, ob); in range_count()
568 count = _PySequence_IterSearch((PyObject*)r, ob, PY_ITERSEARCH_COUNT); in range_count()
576 range_index(rangeobject *r, PyObject *ob) in range_index() argument
580 if (!PyLong_CheckExact(ob) && !PyBool_Check(ob)) { in range_index()
582 index = _PySequence_IterSearch((PyObject*)r, ob, PY_ITERSEARCH_INDEX); in range_index()
588 contains = range_contains_long(r, ob); in range_index()
593 PyObject *idx = PyNumber_Subtract(ob, r->start); in range_index()
609 PyErr_Format(PyExc_ValueError, "%R is not in range", ob); in range_index()