Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError when using kite_tutorial #15324

Closed
castorfou opened this issue Apr 17, 2021 · 3 comments · Fixed by #15447
Closed

TypeError when using kite_tutorial #15324

castorfou opened this issue Apr 17, 2021 · 3 comments · Fixed by #15447

Comments

@castorfou
Copy link

Description

What steps will reproduce the problem?

follow instructions in kite_tutorial.py

just type a in line 84 to try autocompletion fwhen importing matplotlib

boom

Traceback

Traceback (most recent call last):
  File "/home/explore/miniconda3/envs/minecraft/lib/python3.6/site-packages/spyder/plugins/editor/widgets/codeeditor.py", line 4490, in _handle_completions
    if (len(text) >= self.automatic_completions_after_chars
TypeError: '>=' not supported between instances of 'int' and 'tuple'

Versions

  • Spyder version: 5.0.0
  • Python version: 3.6.13
  • Qt version: 5.9.6
  • PyQt5 version: 5.9.2
  • Operating System: Linux 5.4.0-72-generic

Dependencies


# Mandatory:
atomicwrites >=1.2.0          :  1.4.0 (OK)
chardet >=2.0.0               :  4.0.0 (OK)
cloudpickle >=0.5.0           :  1.6.0 (OK)
cookiecutter >=1.6.0          :  1.7.2 (OK)
diff_match_patch >=20181111   :  20200713 (OK)
intervaltree >=3.0.2          :  3.1.0 (OK)
IPython >=7.6.0               :  7.16.1 (OK)
jedi =0.17.2                  :  0.17.2 (OK)
jsonschema >=3.2.0            :  3.2.0 (OK)
keyring >=17.0.0              :  22.3.0 (OK)
nbconvert >=4.0               :  6.0.7 (OK)
numpydoc >=0.6.0              :  1.1.0 (OK)
parso =0.7.0                  :  0.7.0 (OK)
pexpect >=4.4.0               :  4.8.0 (OK)
pickleshare >=0.4             :  0.7.5 (OK)
psutil >=5.3                  :  5.8.0 (OK)
pygments >=2.0                :  2.8.1 (OK)
pylint >=1.0                  :  2.7.4 (OK)
pyls >=0.36.2;<1.0.0          :  0.36.2 (OK)
pyls_black >=0.4.6            :  0.4.6 (OK)
pyls_spyder >=0.3.2           :  0.3.2 (OK)
qdarkstyle =3.0.2             :  3.0.2 (OK)
qstylizer >=0.1.10            :  0.1.10 (OK)
qtawesome >=0.5.7             :  1.0.2 (OK)
qtconsole >=5.0.3             :  5.0.3 (OK)
qtpy >=1.5.0                  :  1.9.0 (OK)
rtree >=0.8.3                 :  0.9.7 (OK)
setuptools >=39.0.0           :  52.0.0.post20210125 (OK)
sphinx >=0.6.6                :  3.5.3 (OK)
spyder_kernels >=2.0.1;<2.1.0 :  2.0.1 (OK)
textdistance >=4.2.0          :  4.2.1 (OK)
three_merge >=0.1.1           :  0.1.1 (OK)
watchdog >=0.10.3;<2.0.0      :  1.0.2 (OK)
xdg >=0.26                    :  0.27 (OK)
zmq >=17                      :  20.0.0 (OK)

# Optional:
cython >=0.21                 :  None (NOK)
matplotlib >=2.0.0            :  None (NOK)
numpy >=1.7                   :  None (NOK)
pandas >=1.1.1                :  None (NOK)
scipy >=0.17.0                :  None (NOK)
sympy >=0.7.3                 :  None (NOK)
@ccordoba12
Copy link
Member

Hey @castorfou. thanks for reporting. We'll take a look at this problem.

@dalthviz, could you take a look at this? Thanks!

@dalthviz
Copy link
Member

@ccordoba12 @castorfou I was able to replicate this but first I had to change the preferences to enable autocompletion results after just 1 character (the default is 3 I think):

auto

@ccordoba12 ccordoba12 added this to the v5.0.2 milestone Apr 19, 2021
@ccordoba12 ccordoba12 changed the title internal probelm using kite_tutorial TypeError when using kite_tutorial Apr 22, 2021
@dalthviz
Copy link
Member

Note: The issue is actually caused not for an specific value but because of the change of the value. When changing it, it causes the self.automatic_completions_after_chars to become a tuple instead of just updating is number value (the tuple has the actual updated value inside). Strangely, after a Spyder restart the value is set properly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment