Hi Serhiy Thank you for so clearly explaining how names get passed to function and class constructors. You also wrote:
We do not have generalized way to call arbitrary constructor with automatically passing __name__, __qualname__ and __module__. And it would be convenient.
create namedtuple Point(x, y, z=0) [further examples snipped]
We can already do something similar by writing (not tested) class Point(Hack): namedtuple = lambda x, y, z=0: None provided Hack has a suitable value. I don't see a way to do much better than this, without introducing a new language keyword. For example allow signature(x, y, z=0) to be an EXPRESSION that returns a function signature. By the way, class Point(Hack): def namedtuple(x, y, z=0): pass gives a syntax error at 'def'. -- Jonathan