8 Commits
Author SHA1 Message Date
Changjoon cc78dcb858 Match CPython's "argument of type ... is not a container or iterable" wording (#7714)
CPython's PySequence_Contains (Objects/abstract.c::_PySequence_IterSearch)
catches the TypeError from PyObject_GetIter when neither __contains__ nor
__iter__ is available, and re-raises with membership-test wording.

RustPython's PySequence::contains propagated the get_iter error verbatim,
so '1 in obj' produced 'X' object is not iterable — a literal but less
specific message.

Wrap the get_iter call in map_err: when the failure is a TypeError,
re-raise with byte-identical CPython wording. Other exception types pass
through unchanged.

Unmasks test_contains.TestContains.test_common_tests.
2026-04-29 18:29:31 +09:00
Shahar Naveh 1b149e9a21 Update test_{binop,contains}.py from 3.14.3 (#7038) 2026-02-08 10:00:50 +09:00
Shahar Naveh 3f9a5fddbb Don't skip non hanging test (#5951) 2025-07-12 19:18:08 +09:00
CPython developers 8a6fc05893 Update test_contains from CPython 3.10.5 2022-07-18 04:07:35 +09:00
Padraic Fanning e5e260a161 Explain test_builtin_sequence_types skip 2021-02-07 15:49:41 -05:00
Jeong YunWon 838abb8b76 Add collections.deque.__contains__ 2020-07-08 03:30:40 +09:00
Aviv Palivoda 7c3b4c3802 Mark unsupported tests 2020-02-22 14:32:22 +02:00
Aviv Palivoda af933f8ba5 Add test_contains from CPython 3.8 2020-02-22 14:31:12 +02:00