Bug 297 - nmutil "flatten" function already exists
Summary: nmutil "flatten" function already exists
Status: CONFIRMED
Alias: None
Product: Libre-SOC's first SoC
Classification: Unclassified
Component: Source Code (show other bugs)
Version: unspecified
Hardware: PC Linux
: --- enhancement
Assignee: Luke Kenneth Casson Leighton
URL:
Depends on:
Blocks:
 
Reported: 2020-05-01 14:31 BST by Luke Kenneth Casson Leighton
Modified: 2020-05-02 00:04 BST (History)
3 users (show)

See Also:
NLnet milestone: ---
total budget (EUR) for completion of task and all subtasks: 0
budget (EUR) for this task, excluding subtasks' budget: 0
parent task for budget allocation:
child tasks for budget allocation:
The table of payments (in EUR) for this task; TOML format:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Luke Kenneth Casson Leighton 2020-05-01 14:31:54 BST
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
Comment 1 whitequark 2020-05-01 21:51:33 BST
Anything that starts with _ is a private function according to Python conventions and can be changed or removed without notice by nMigen.
Comment 2 Jacob Lifshay 2020-05-01 22:28:24 BST
(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?
Comment 3 whitequark 2020-05-01 22:55:15 BST
> 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.
Comment 4 Jacob Lifshay 2020-05-01 23:00:08 BST
(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.
Comment 5 Luke Kenneth Casson Leighton 2020-05-02 00:04:36 BST
sigh.  it has to be a public function of a pacjsge... by us.  named nmutil.