[ python-Bugs-1459733 ] sets.Set can't be subclassed
SourceForge.net
noreply at sourceforge.net
Tue Mar 28 09:48:40 CEST 2006
Bugs item #1459733, was opened at 2006-03-28 02:37
Message generated for change (Comment added) made by gbrandl
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1459733&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.3
>Status: Closed
>Resolution: Invalid
Priority: 5
Submitted By: Michal Kwiatkowski (rubyjoker)
Assigned to: Nobody/Anonymous (nobody)
Summary: sets.Set can't be subclassed
Initial Comment:
sets.Set class fail to hide its implementation.
Subclassing it and overriding __init__ causes an
exception during object creation.
----------------------------------------------------------------------
>Comment By: Georg Brandl (gbrandl)
Date: 2006-03-28 07:48
Message:
Logged In: YES
user_id=849994
Ziga is correct, this is Invalid.
----------------------------------------------------------------------
Comment By: iga Seilnacht (zseil)
Date: 2006-03-28 06:33
Message:
Logged In: YES
user_id=1326842
This is a bug in your code, you have to call
the base class's __init__ method. The error
does not occur during the object creation,
but later when repr(obj) fails due to incorrect
initialization.
----------------------------------------------------------------------
Comment By: Michal Kwiatkowski (rubyjoker)
Date: 2006-03-28 02:41
Message:
Logged In: YES
user_id=1310227
I'm posting a proposed patch with a test case covering this
bug (shouldn't all standard library modules have tests?). It
may introduce performance lost, as it removes __slots__
definition.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1459733&group_id=5470
More information about the Python-bugs-list
mailing list