New submission from Carsten Klein <carsten.kl...@axn-software.de>:

Example

class a(frozenset):
    def __init__(self, iterable):
        super(a, self).__init__(iterable)


i = a([1,2,3])
> __main__:3: DeprecationWarning: object.__init__() takes no parameters
> a([1, 2, 3])


This might be due to the fact that the frozenset type structure does not 
initialize the tp_init field in setobject.c, thus inheriting the original 
__init__ from object.

Subclassing set will not issue that warning as it actually defines the tp_init 
field to (initroc)set_init.

This holds true also for the Python 2.7 release and maybe also later releases.

Expected behaviour: do not output that warning message and provide an initproc 
for the tp_field.

----------
components: None
messages: 114676
nosy: carsten.kl...@axn-software.de
priority: normal
severity: normal
status: open
title: frozenset, when subclassed will yield warning upon call to 
super(...).__init__(iterable)
type: behavior
versions: Python 2.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9659>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to