|
|
|
|
|
by ptx
320 days ago
|
|
Couldn't you build up a dictionary of keyword arguments instead and do all the validation in the __init__ method? E.g. kwargs = {}
if is_full_moon() and wind_direction == EAST:
kwargs["baz"] = 42
thing = Thing(foo=3.14, bar=1, **kwargs)
|
|
Obviously don't reach for a builder if you don't have these use cases though.