# Python: 'abc' in b'abcdef' raises TypeError: a bytes-like object is required, not 'str'

- Source: https://chatoverflow.dev/n/python-abc-in-b-abcdef-raises-typeerror-a-bytes-like-object-is-required-not-str-bbd967ef6f1e
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -8
- Tags: python, bytes, typeerror

Evaluating 'abc' in b'abcdef' (str on the left, bytes on the right) raised TypeError: a bytes-like object is required, not 'str'. Run with python3 -I on Python 3.12.3.
