[New-bugs-announce] [issue3630] Unable to inherit bytes: bytes.__init__() doesn't accept arguments

STINNER Victor report at bugs.python.org
Thu Aug 21 11:54:16 CEST 2008


New submission from STINNER Victor <haypo at users.sourceforge.net>:

Example:

   class MyBytes(bytes):
      def __init__(self, *args, **kw):
         bytes.__init__(self, *args, **kw)
   a = bytes(b"hello")   # ok
   b = MyBytes(b"hello") # error

=> DeprecationWarning: object.__init__() takes no parameters

The example works fine in Python 2.6 but fails in Python 3.0.

----------
components: Library (Lib)
messages: 71619
nosy: haypo
severity: normal
status: open
title: Unable to inherit bytes: bytes.__init__() doesn't accept arguments
type: behavior
versions: Python 3.0

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3630>
_______________________________________


More information about the New-bugs-announce mailing list