I\'m implementing an object that is almost identical to a set, but requires an extra instance variable, so I am subclassing the built-in set object. What is the best way to
It looks like set bypasses __init__
in the c code. However you will end an instance of Fooset
, it just won't have had a chance to copy the field.
Apart from overriding the methods that return new sets I'm not sure you can do too much in this case. Set is clearly built for a certain amount of speed, so does a lot of work in c.