This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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 <1626296093.59.0.48322222195.issue44603@roundup.psfhosted.org>
In-reply-to
Content
> 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()".
History
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: <1626296093.59.0.48322222195.issue44603@roundup.psfhosted.org>
2021-07-14 20:54:53mark.dickinsonlinkissue44603 messages
2021-07-14 20:54:53mark.dickinsoncreate