Код: Выделить всё
class MyBytes ( bytes ):
def __init__(self,buffer,nb):
self[:] = bytes( buffer )*nb
b = MyBytes( b'123',5 )
Код: Выделить всё
b = MyBytes( b'123',5 )
^^^^^^^^^^^^^^^^^^^
TypeError: bytes() argument 'encoding' must be str, not int
Подробнее здесь: https://stackoverflow.com/questions/798 ... type-bytes
Мобильная версия