Author mark.dickinson
Recipients FFY00, asmeurer, eric.araujo, gregory.p.smith, jack__d, mark.dickinson, p-ganssle, pablogsal, steven.daprano, theacodes, tlalexander, veky
Date 2021-07-14.20:54:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> 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
    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:53mark.dickinsonsetrecipients: + mark.dickinson, gregory.p.smith, eric.araujo, steven.daprano, veky, p-ganssle, pablogsal, asmeurer, FFY00, theacodes, jack__d, tlalexander
2021-07-14 20:54:53mark.dickinsonsetmessageid: <>
2021-07-14 20:54:53mark.dickinsonlinkissue44603 messages
2021-07-14 20:54:53mark.dickinsoncreate