This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Keyword arguments to __init__() of a subclass of set
Type: Stage:
Components: Interpreter Core Versions: Python 2.4
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: nnorwitz Nosy List: jfroejk, nnorwitz
Priority: normal Keywords:

Created on 2007-03-21 06:50 by jfroejk, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg31598 - (view) Author: Jørgen Frøjk Kjærsgaard (jfroejk) Date: 2007-03-21 06:50
Passing a keyword argument to a subclass of the built-in class "set" causes a TypeError in Python 2.4.2 and newer but not in 2.4.0. Example:

class Test(set):
    def __init__(self, a=0):
        self.add(a)

t = Test(a=0)

In Python 2.4.0 it works as expected whereas in 2.4.2 and 2.4.4, it yields:

Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: set() does not take keyword arguments

I don't pass a keyword argument to set.__init__() but to its subclass!
msg31599 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2007-03-21 06:59
2.4 is no longer supported.  This has been fixed in 2.5.  I don't have the original bug report #.  You can find the fix in SVN if you would like to build your own patched version.
History
Date User Action Args
2022-04-11 14:56:23adminsetgithub: 44750
2007-03-21 06:50:18jfroejkcreate