ARTICLE AD BOX
here is a very simple snippet that shows by problem :
class MyBytes ( bytes ): def __init__(self,buffer,nb): self[:] = bytes( buffer )*nb b = MyBytes( b'123',5 )When I run it, it get this error :
b = MyBytes( b'123',5 ) ^^^^^^^^^^^^^^^^^^^ TypeError: bytes() argument 'encoding' must be str, not intIt's like if my overload of the constructor was ignored...
Maybe there is trick when overloading a builtin type ?
Any idea ?
Thanx in advance
