Description
I am hoping to be able to define cells like this, which is a common pattern in existing notebooks.
cell1:
fig, ax = plt.subplots()
ax.plot(...)
cell2:
fig, ax = plt.subplots()
ax.plot(...)
This is a pretty common pattern and the multiple definitions are not a problem since the variables are never read before they are assigned to in any cell.
Suggested solution
Allow multiple definitions of a variable if it is never read before being assigned to in any cell.
Alternative
One alternative is
_fig, _ax = plt.subplots()
_ax.plot(1, 2)
another is (e.g.):
def _():
fig, ax = plt.subplots()
ax.plot(1, 2)
_()
But neither is very pretty imo.
Additional context
No response
Description
I am hoping to be able to define cells like this, which is a common pattern in existing notebooks.
cell1:
cell2:
This is a pretty common pattern and the multiple definitions are not a problem since the variables are never read before they are assigned to in any cell.
Suggested solution
Allow multiple definitions of a variable if it is never read before being assigned to in any cell.
Alternative
One alternative is
another is (e.g.):
But neither is very pretty imo.
Additional context
No response