.. index:: py::builtins::in .. _doxycast_pypp_classpy_1_1builtins_1_1in: .. _py-builtins-in: *py::builtins::*\ in ==================== *Defined in* ```` .. code-block:: cpp template class in; Implements Python's ``in`` operator. ``py::builtins::in`` implements Python's ``in`` operator, used to check whether a iterable contains a value. Template parameters ------------------- ``type``: The type of iterable. Members ------- * :ref:`in ` * :ref:`container ` .. toctree:: :hidden: in container Non-member helpers ------------------ * :ref:`operator ->* ` Example ------- .. code-block:: cpp #include #include #include int main() { py::list nums = {0, 1, 2, 3, 4, 5, 6}; // Equivalent to ``4 in nums`` in Python py::print(4 ->* py::in(nums)); } **Output**: .. code-block:: text true