Message397507
> 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()". |
|
Date |
User |
Action |
Args |
2021-07-14 20:54:53 | mark.dickinson | set | recipients:
+ mark.dickinson, gregory.p.smith, eric.araujo, steven.daprano, veky, p-ganssle, pablogsal, asmeurer, FFY00, theacodes, jack__d, tlalexander |
2021-07-14 20:54:53 | mark.dickinson | set | messageid: <1626296093.59.0.48322222195.issue44603@roundup.psfhosted.org> |
2021-07-14 20:54:53 | mark.dickinson | link | issue44603 messages |
2021-07-14 20:54:53 | mark.dickinson | create | |
|