question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem in autocompletion of class attributes in Spyder 4 editor

See original GitHub issue

Issue Report Checklist

  • Searched the issues page for similar reports
  • Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • Could not reproduce inside jupyter qtconsole (if console-related)
  • Tried basic troubleshooting (if a bug/error)
    • Restarted Spyder
    • Reset preferences with spyder --reset
    • Reinstalled the latest version of Anaconda
    • Tried the other applicable steps from the Troubleshooting Guide
  • Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

On Spyder 3.6.6, it was possible to watch the attributes and methods of a loaded object in the editor (thanks to rope and jedi). With python 4.0.0, it is not possible to visualize them. I’m not sure if this is a problem from Kite App or another change in the Spyder 4.0.0 new Completion and linting functionalities. I tried several configurations (by changing Completion and Linting parameters) to retrieve my previous Spyder user experience but without success. I don’t see what’s the problem here.

Note : I’m aware and tried to configure Adding libraries from PYTHONPATH to the Kite index . But it does not seem to be the problem.

What steps reproduce the problem?

Simply create file myclass.py with a class with one attribute:

class MyClass():
    def __init__(self,param):
        self.param=param

Then import myclass and create an object A with param=10, for instance:

import myclass
A=myclass.MyClass(10)
A.

What is the expected output? What do you see instead?

On Spyder 4.0.0 editor autocompletion after the dot shows ‘ArithmeticError; AssertionError;…’ while in Spyder 3.6 editor autocompletion suggested my usual methods and attribute loaded in My_Class. Here My_Class.param.

PS: I did not produce a screenshot since autocompletion suggestions disappear when prt scr

Versions

  • Spyder version: 3.3.6 and 4.0.0
  • Python version: 3.7.3
  • Qt version: 5.9.7
  • PyQt version: 5.9.2
  • Operating System name/version: Ubuntu 18.04.3

Dependencies

cloudpickle >=0.5.0 : 1.0.0 (OK) pygments >=2.0 : 2.4.0 (OK) qtconsole >=4.6.0 : 4.6.0 (OK) nbconvert >=4.0 : 5.5.0 (OK) sphinx >=0.6.6 : 2.0.1 (OK) pylint >=0.25 : 2.3.1 (OK) psutil >=0.3 : 5.6.2 (OK) qtawesome >=0.5.7 : 0.5.7 (OK) qtpy >=1.5.0 : 1.7.1 (OK) pickleshare >=0.4 : 0.7.5 (OK) zmq >=17 : 18.0.0 (OK) chardet >=2.0.0 : 3.0.4 (OK) numpydoc >=0.6.0 : 0.9.1 (OK) spyder_kernels >=1.8.1;<2.0.0: 1.8.1 (OK) qdarkstyle >=2.7 : 2.7 (OK) atomicwrites >=1.2.0 : 1.3.0 (OK) diff_match_patch >=20181111 : 20181111 (OK) intervaltree : None (OK) watchdog : None (OK) keyring : None (OK) pexpect >=4.4.0 : 4.7.0 (OK) pympler : None (OK) sympy >=0.7.3 : 1.4 (OK) cython >=0.21 : None (NOK) IPython >=4.0 : 7.5.0 (OK) matplotlib >=2.0.0 : 3.1.0rc2 (OK) pandas >=0.13.1 : None (NOK) numpy >=1.7 : 1.16.3 (OK) scipy >=0.17.0 : 1.2.1 (OK) pyls >=0.31.2;<0.32.0 : 0.31.2 (OK) xdg >=0.26 : 0.26 (OK) rtree >=0.8.3 : 0.9.3 (OK)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
ElieGouziencommented, May 14, 2020

I can confirm this problem still exist in 4.1.3. A minimal example would be:

d = {}
d.

even when requesting manually completion nothing happens.

0reactions
venkatgmrit05commented, Jun 26, 2020

I agree with you. I do apologize. Thank you for working on the fix. I am looking forward to it. I appreciate the work you guys do on Spyder. Regards, Uma Venkat, Karanam MSME, SUNY Buffalo +16476793681 Linkedin: https://www.linkedin.com/in/umavenkat-karanam-0568341b/

On Thu, Jun 25, 2020 at 5:22 PM Carlos Cordoba notifications@github.com wrote:

@venkatgmrit05 https://github.com/venkatgmrit05, please don’t post random comments about your frustrations with Spyder 4 in other people’s issues. That’s simply not polite.

About the issues you’re having with code completion and linting, many people have reported the same problem but we couldn’t find a way to reproduce it until very recently (a bit more than a month). So we didn’t know how to fix it.

After that, we’ve put a ton of effort on making that part of our codebase more robust and error proof, so (hopefully) those problems will be much less frequent after we release version 4.1.4 next week.

I didn’t understand your problems with the Variable Explorer, so please open a new issue about them and don’t forget to upload screenshots or (better yet) animated gifs (that you can create with the Licecap program) for us to be able to reproduce them.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/spyder-ide/spyder/issues/11118#issuecomment-649824323, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACEMZTPAK5RETZDUAO7BK2LRYO5Y5ANCNFSM4J32CYLQ .

Read more comments on GitHub >

github_iconTop Results From Across the Web

python spyder editor autocompletion and inspection of ...
The same problem arises, if a class is created with type(classname, (), clsdict) . In that case, one only finds mro inside the...
Read more >
auto completion for dynamic module attributes in python
I was trying to dynamicly create attribute for instance. It works, but it will be better if the dynamic attribute can be auto-completed....
Read more >
Spyder 5.0.1 Kite Autocompletion Issues Including Latency
Now if I type in a class/function with open parenthesis. This seems to work with Kite both in the script editor and console....
Read more >
jedi - PyPI
Jedi is a static analysis tool for Python that is typically used in IDEs/editors plugins. Jedi has a focus on autocompletion and goto...
Read more >
IDE - QuantConnect.com
Use Autocomplete · Open a project. · Type the first few characters of a variable, function, class, or class member that you want...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found