Menu

#740 auto-import symbol name clash warning too noisy

closed
nobody
None
5
2021-05-07
2021-04-26
No

For years Autoplot's Jython scripting has warned when a symbol is redefined in a script. These are really the functions which are automatically defined before the script is run, and then are redefined in the script. This was initially coded after I named a variable "plot" and then tried later to plot something, and I was very confused by the error message. So now as soon as you try to assign something to "plot" you'll get a yellow warning.

While "plot" is definitely a name to be avoided, names like "mode" are pretty harmless. So I think the noisy warning should only fire when the reused symbol is used as a function. This also has the virtue of preventing an attack when some hostile imported code tries to redefine a name.

This screenshot shows the current behavior.

1 Attachments

Discussion

  • Jeremy Faden

    Jeremy Faden - 2021-04-28

    This works nicely now, only giving a warning when the symbol is used as a function after reassignment.

     
  • Jeremy Faden

    Jeremy Faden - 2021-05-07
    • status: open --> closed
     
MongoDB Logo MongoDB