Code: Select all
class MyBytes ( bytes ):
def __init__(self,buffer,nb):
self[:] = bytes( buffer )*nb
b = MyBytes( b'123',5 )
Code: Select all
b = MyBytes( b'123',5 )
^^^^^^^^^^^^^^^^^^^
TypeError: bytes() argument 'encoding' must be str, not int
Code: Select all
class MyBytes ( bytes ):
def __init__(self,buffer,nb):
self[:] = bytes( buffer )*nb
b = MyBytes( b'123',5 )
Code: Select all
b = MyBytes( b'123',5 )
^^^^^^^^^^^^^^^^^^^
TypeError: bytes() argument 'encoding' must be str, not int