You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unable to inherit bytes: bytes.__init__() doesn't accept arguments #47880
With immutable types, you must use __new__ instead. Passing the
arguments to __init__ is too late since the object is immutable and it
has already been built in memory, thus you can't initialize it with
another value.
Activity
vstinner commentedon Aug 21, 2008
Example:
=> DeprecationWarning: object.__init__() takes no parameters
The example works fine in Python 2.6 but fails in Python 3.0.
pitrou commentedon Aug 21, 2008
With immutable types, you must use __new__ instead. Passing the
arguments to __init__ is too late since the object is immutable and it
has already been built in memory, thus you can't initialize it with
another value.