Skip to content

[feature] Fall back to pretty print in REPL #183

@MadameMinty

Description

@MadameMinty

In Python < 3.13 REPL:

>>> ic()
ic| Error: Failed to access the underlying source code for analysis. Was ic() invoked in a REPL (e.g. from the command line), a frozen application (e.g. packaged with PyInstaller), or did the underlying source code change during execution?

Suggestion: upon this error, fall back to pretty printing args & kwargs or current time if none, so that e.g. copy-pasting code fragments including icecream calls still yields some benefits, and it could be used to override builtin from icecream import ic as print in a pinch. Possibly update documentation to note this behavior since the error won't be informative.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions