You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue is the new var_expand, which uses a DollarFormatter, rather than ItplNS. Formerly, $ was the only expansion, but since we now use string formatting, the {name} syntax is acceptable, and the magic is trying to format the string. This wasn't an issue, because variables wer unambiguous, as they were not Python syntax, but they are now.
The magic argument transform is proving itself to be in irredeemable mess, and needs to be reconsidered in a much cleaner way. For instance, this var_expand call should never be made on magics that aren't shell-ish.
Temporary workaround to just disable variable expansion, if you need it:
get_ipython().var_expand=lambdas, *args, **kwargs: s
ignore errors in shell.var_expand
If an error is raised in the formatter, leave it untransformed. This means that var_expand("$foo") will return "$foo" if foo is undefined, but more importantly it will not raise when var_expand is used on literal code that doesn't expect to be expanded (e.g. %prun arguments).
closesipython#1412
The text was updated successfully, but these errors were encountered: