def __new__(cls, *pars, **opts):
        "Initialize all attributes in the signature and any other options supplied"
        try:
            self = super().__new__(cls, *pars, **opts)
        except:
            self = super().__new__(cls)
        self._argspec = names, parsname, optsname, defaults = getargspec(self.__init__)
        if not defaults: defaults = []
        n = len(names) - len(defaults) - 1
        if n - len(pars) > 0:
            _s, _to = ('s', '-%d' % (n-1)) if n - len(pars) > 1 else ('', '')
            missing =  "%s %s (pos %d%s)" % (_s, ", ".join(names[1:n+1]), len(pars), _to)
            raise TypeError("Required argument%s not found." % missing)
        for n, v in chain(zip(names[-len(defaults):], defaults), zip(names[1:], pars), opts.items()):
            setattr(self, n, v)
        return self
Initialize all attributes in the signature and any other options supplied
recipes/Python/578973_Easy_attribute_setting_pretty/recipe-578973.py