2 ms·
If you really want it to look more traditional, you could do: NT.new = lambda **kwargs: NT(42, 'foo')._replace(**kwargs) Now you can make NT objects like
by sevensor 9y ago
If you really want it to look more traditional, you could do:
NT.new = lambda **kwargs: NT(42, 'foo')._replace(**kwargs)
Now you can make NT objects like so:
nt1 = NT.new()
nt2 = NT.new(b='bar')
You can call it something else if calling it "new" makes you feel weird. (I'd call it something else, but naming things is hard.)