[issue6861] bytearray.__new__ doesn't subclass

kai zhu report at bugs.python.org
Tue Sep 8 03:56:16 CEST 2009


New submission from kai zhu <kaizhu256 at gmail.com>:

# a00.py

parent = bytearray # fails
# parent = bytes   # works
# parent = str     # works

class Foo(parent):

  def __new__(klass, x): return parent.__new__(klass, x)

Foo(x = None)



$ python3.1 -c "import a00"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "a00.py", line 11, in <module>
    Foo(x = None)
TypeError: 'x' is an invalid keyword argument for this function
lethe 3 /tmp/kaizhu/Python-3.1.1:

----------
components: Interpreter Core, Library (Lib)
messages: 92406
nosy: kaizhu
severity: normal
status: open
title: bytearray.__new__ doesn't subclass
type: behavior
versions: Python 3.1

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


More information about the Python-bugs-list mailing list