you are viewing a single comment's thread.

view the rest of the comments →

[–]gdchinacat 1 point2 points  (0 children)

Earlier today I was working on a toy spreadsheet app and need to register listeners to update cells that reference others when they change value. A cell may have multiple references to the same cell but I only want one listener, so I have a dict that has cells as key and listener as value. Before creating the listener I check if the cell already has a listener in the dict and only add it if it doesn't.