nmigen already has a flatten function: from nmigen._utils import flatten whether we can rely on that staying there needs to be investigated with whitequark
Anything that starts with _ is a private function according to Python conventions and can be changed or removed without notice by nMigen.
(In reply to whitequark from comment #1) > Anything that starts with _ is a private function according to Python > conventions and can be changed or removed without notice by nMigen. That's what I thought. Would you be open to changing `flatten` to a public API, or should we just keep using the duplicate in nmutil?
> Would you be open to changing `flatten` to a public API Why should it be a public API of nmigen? It's a general purpose utility function for iterables. It should be a public API of itertools, or another package like that.
(In reply to whitequark from comment #3) > > Would you be open to changing `flatten` to a public API > > Why should it be a public API of nmigen? It's a general purpose utility > function for iterables. It should be a public API of itertools, or another > package like that. yeah, makes sense. Luke, unless you want to pursue that option, I'll let you close this as won't-fix.
sigh. it has to be a public function of a pacjsge... by us. named nmutil.