Skip to content

Deleting a cell doesn't let you redefine the cell's variables #1016

@riyavsinha

Description

@riyavsinha

Describe the bug

After a cell is deleted or a variable is even just declared in a cell, I cannot move that variable declaration to a different cell

Steps:

  1. Create and run cell with x = 4
  2. Delete cell
  3. Create and run new cell with x = 3

Error:

This cell wasn't run because it has errors
The variable 'x' was defined by another cell:

Tip:
Try merging this cell with the above cells. Alternatively, rename 'x' to '_x' to make the variable private to this cell.

(Side note, I don't think merging cells is a thing right now right? Tried searching the docs)

I can see the use of private variables as being good practice to do generally, but when a cell is deleted it would still be nice to be able to free up that variable for redeclaration.

I ran into this when I was simply trying to reorganize my notebook a bit.

Environment

(was just reproducing on marimo.app)

Code to reproduce

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions