plotly.py icon indicating copy to clipboard operation
plotly.py copied to clipboard

Add __or__, __ror__, __ior__ methods to BasePlotlyType to support dict-like updates via pipe operator

Open janosh opened this issue 2 years ago • 1 comments

@nicolaskruchten I'm not very familiar with the plotly code base so feel a bit like an elephant in a porcelain shop. But maybe this is first step in the right direction for #4046. Just a rough first draft to solicit feedback at this point. No tests yet.

Closes #4046

janosh avatar Jan 30 '23 19:01 janosh

@janosh this looks great, apologies for taking so long to review. One question: does this apply magic underscores? ie if we do things like fig.layout.update(margin_pad=4) do we get {'margin': {'pad': 4}}?

No comments on the code, looks good to me. Just need some tests I guess in test_update_objects, and a changelog entry (after merging master in, which should get the tests passing again).

alexcjohnson avatar Jun 04 '23 02:06 alexcjohnson