Open jonpovey opened 2 years ago
Hi @jonpovey Not sure if I like it - you do not need to randomize an object to use it. I agree it is an additional code needed, but also readability is better. I don't like being too pythonic by reducing amount of code, paying the clarity price. I would agree to add this feature if there are more votes.
I have been reading the documentation (and source) for
Randomized
andadd_rand()
It seems likeadd_rand()
could create an attribute if it is not found in the object, and perhaps initialise it to the first element in the domain list. It seems like this would reduce boilerplate in common code where currently the examples require writingself.x = some_dummy_value
beforeadd_rand("x", ...)