Is there a simpler way of doing the following?
(set() for _ in itertools.repeat(None))
Note that it is different to itertools.repeat(set())
, since the latter only constructs the set object once.
You can do
iter(set, None)
which calls the given callable until it returns None
(what it won't).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With