Mark Dickinson <[email protected]> added the comment:
> the confusion that it can cause when there is a mismatch between the
> interactive interpreter and noninteractive execution
I've witnessed similar confusion when teaching, using IPython. After
discovering that you can do
In [1]: import pandas as pd
In [2]: cd datafiles
/Users/mdickinson/Desktop/datafiles
In [3]: df = pd.read_csv("experiment0023.csv")
it's then a common error to copy those lines to a script and expect them to
work. We learned to recommend that IPython's automagic always be turned off, so
that at least we could easily explain that "if it starts with a %, it's a magic
command interpreted by the IPython layer; otherwise it's passed to Python".
If Python grew a similar interpreter layer (which seems like one possible
solution here), I think we'd have the same issue of making it easy for users to
distinguish "commands" intended for the interactive interpreter from those
interpreted by the Python core. I could imagine ending up with users typing
"%exit" or "!exit" to exit, but one you're adding an extra sigil to distinguish
your commands from plain old references to Python objects it doesn't seem so
different from having to type "exit()".
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue44603>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com