Giter VIP home page Giter VIP logo

Comments (3)

Carreau avatar Carreau commented on June 9, 2024 1

ok, all good then.

Yes I'm going to close as I don't think there is much actionable.

But thanks for opening the issue just in case.

from ipython.

Carreau avatar Carreau commented on June 9, 2024

Do you have any custom configuration ?

I can't reproduce so it's hard to find which object returns a None repr:

$ ipython
Python 3.12.3 | packaged by conda-forge | (main, Apr 15 2024, 18:35:20) [Clang 16.0.6 ]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.24.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: globals()
Out[1]:
{'__name__': '__main__',
 '__doc__': 'Automatically created module for IPython interactive environment',
 '__package__': None,
 '__loader__': None,
 '__spec__': None,
 '__builtin__': <module 'builtins' (built-in)>,
 '__builtins__': <module 'builtins' (built-in)>,
 '_ih': ['', 'globals()'],
 '_oh': {},
 '_dh': [PosixPath('/.../ipython')],
 'In': ['', 'globals()'],
 'Out': {},
 'get_ipython': <bound method InteractiveShell.get_ipython of <IPython.terminal.interactiveshell.TerminalInteractiveShell object at 0x105733d70>>,
 'exit': <IPython.core.autocall.ExitAutocall at 0x10582f2f0>,
 'quit': <IPython.core.autocall.ExitAutocall at 0x10582f2f0>,
 'open': <function _io.open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)>,
 '_': '',
 '__': '',
 '___': '',
 'Module': ast.Module,
 'FunctionDef': ast.FunctionDef,
 'Pass': ast.Pass,
 'arguments': ast.arguments,
 'indent': <function textwrap.indent(text, prefix, predicate=None)>,
 'formatter': <IPython.core.formatters.PlainTextFormatter at 0x10582dfa0>,
 'repr_module': <function __main__.repr_module(module, p, cycle)>,
 'arg': <function __main__.arg(p, obj, name)>,
 'repr_FunctionDef': <function __main__.repr_FunctionDef(fun, p, cycle)>,
 'ast': <module 'ast' from '...'>,
 '_i': '',
 '_ii': '',
 '_iii': '',
 '_i1': 'globals()'}

In [2]:

from ipython.

trag1c avatar trag1c commented on June 9, 2024

Yup, found the culprit—it's exit and quit, caused by my startup file:

type(exit).__repr__ = lambda self: self()

This "backports" IPython's behavior of quitting with just exit instead of exit() to the built-in REPL. I didn't realize IPython was also using this startup file 😄 And I guess I thought this was an IPython issue since the default REPL doesn't exit since it doesn't include exit nor quit in its globals().

I guess that makes this issue invalid?

from ipython.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.