.. _invalid-bytes-returned: invalid-bytes-returned / E0308 ============================== **Message emitted:** ``__bytes__ does not return bytes`` **Description:** *Used when a __bytes__ method returns something which is not bytes* **Problematic code:** .. literalinclude:: /data/messages/i/invalid-bytes-returned/bad.py :language: python **Correct code:** .. literalinclude:: /data/messages/i/invalid-bytes-returned/good.py :language: python Created by the `classes `__ checker.