mirror of
https://github.com/pocketpy/pocketpy
synced 2026-03-22 21:20:17 +00:00
Add __iter__ method to bytes type and implement bytes_iterator type. This allows iterating over bytes objects to get individual byte values as integers (0-255), matching Python's behavior. Changes: - include/pocketpy/objects/iterator.h: Add bytes_iterator struct - include/pocketpy/pocketpy.h: Add tp_bytes_iterator type constant - include/pocketpy/interpreter/vm.h: Declare pk_bytes_iterator__register - src/bindings/py_str.c: Implement bytes__iter__ and bytes_iterator__next__ - src/interpreter/vm.c: Register bytes_iterator type Fixes #450