Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
__new__ solution in Clear category for Capital City by m.kurapov
class Capital:
_instance = None
_name = None
def __new__(cls, _name, *args, **kwargs):
if not Capital._instance:
Capital._instance = super(Capital, cls).__new__(cls, *args, **kwargs)
Capital._name = _name
return Capital._instance
def __init__(self, city_name):
pass
def name(self):
return self._name
March 13, 2020