Please improve these comprehensions (was meaning of [ ])
Ben Bacarisse
ben.usenet at bsb.me.uk
Wed Sep 6 18:27:22 EDT 2017
Rustom Mody <rustompmody at gmail.com> writes:
<snip>
> I posted it because I genuinely thought I had missed some obvious way
> of splitting a set into an (arbitrary) element and a rest without
> jumping through hoops. Evidently not
Curious, because I posted because I thought you had. Anyway, for speed
you probably just want
def cs(n, r): return frozenset({frozenset(s) for s in c(n, r)})
as suggested.
--
Ben.
More information about the Python-list
mailing list