Stewori / pytypes

Typing-toolbox for Python 3 _and_ 2.7 w.r.t. PEP 484.
Apache License 2.0
200 stars 20 forks source link

Crashes ipython #85

Closed twoertwein closed 4 years ago

twoertwein commented 4 years ago

Importing pytypes (1.0b5) in ipython crashes ipython. It works in python.

This might be an ipython bug?

$ ipython
Python 3.7.6 (default, Jan  8 2020, 19:59:22) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.11.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import pytypes                                                                                                                                   

Traceback (most recent call last):
  File "/home/torsten/miniconda3/envs/panama/bin/ipython", line 11, in <module>
    sys.exit(start_ipython())
  File "/home/torsten/miniconda3/envs/panama/lib/python3.7/site-packages/IPython/__init__.py", line 126, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
  File "/home/torsten/miniconda3/envs/panama/lib/python3.7/site-packages/traitlets/config/application.py", line 664, in launch_instance
    app.start()
  File "/home/torsten/miniconda3/envs/panama/lib/python3.7/site-packages/IPython/terminal/ipapp.py", line 356, in start
    self.shell.mainloop()
  File "/home/torsten/miniconda3/envs/panama/lib/python3.7/site-packages/IPython/terminal/interactiveshell.py", line 558, in mainloop
    self.interact()
  File "/home/torsten/miniconda3/envs/panama/lib/python3.7/site-packages/IPython/terminal/interactiveshell.py", line 541, in interact
    code = self.prompt_for_code()
  File "/home/torsten/miniconda3/envs/panama/lib/python3.7/site-packages/IPython/terminal/interactiveshell.py", line 469, in prompt_for_code
    **self._extra_prompt_options())
  File "/home/torsten/miniconda3/envs/panama/lib/python3.7/site-packages/IPython/terminal/interactiveshell.py", line 436, in _extra_prompt_options
    processor=HighlightMatchingBracketProcessor(chars='[](){}'),
  File "/home/torsten/miniconda3/envs/panama/lib/python3.7/site-packages/prompt_toolkit/layout/processors.py", line 359, in __init__
    ] = SimpleCache(maxsize=8)
  File "/home/torsten/miniconda3/envs/panama/lib/python3.7/site-packages/pytypes/__init__.py", line 567, in __Generic__new__
    if cls.__origin__ is None:
AttributeError: type object 'SimpleCache' has no attribute '__origin__'

If you suspect this is an IPython 7.11.1 bug, please report it at:
    https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-dev@python.org

You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
    %config Application.verbose_crash=True
Stewori commented 4 years ago

This looks like a manifestation of #40, i.e. Python 3.7 compatibility rather than a compatibility problem with ipython. Current master has significantly improved Python 3.7 and 3.8 support, however there is still a failing test blocking a new release. These days I am totally occupied and cannot work on this unfortunately. However, I am rather sure the crash wouldn't happen with current master already. So I recommend to use master instead of the latest release when you work on Python 3.7 or 3.8.

twoertwein commented 4 years ago

sorry for the late reply. Yes, the git version does not lead to that crash :)