I want to create a replacement class of the built-in type set that can be constructed exactly like set. Inheritance must not be used because some functions are removed to trigger method not found exceptions. This class is also used to find places where there might be implicit type conversions of the built-in python collection types.
class SetFacade:
def __init__(self, iterable):
self.lst = list(iterable)
# other allowed member functions...
The problem with this constructor definition is, that I cant call the constructor SetFacade() without arguments.
How can I create a constructor that behaves exactly like the built-in set?
Thus it must allow
SetFacade([a,c,b])SetFacade([])SetFacade()
if you want to have an empty constructor…