Skip to content

Improving PyCharm IDE experience #1124

@pyharbor

Description

@pyharbor

Hey I want to start off by saying I like your repository here a lot and use it for many of my own projects. That said I've noticed that compared to other libraries the PyCharm IDE experience is pretty lacking.

I believe the use of lazy_import, which I understand provides some amount of performance gains, also seems to obscure and hide the library from the IDE's autocomplete, intellisense, command + click, etc... features.

Below is an example of the code using the lazy_import, which is exactly how a developer would experience the library after pip installing it in PyCharm

Screen Shot 2022-01-31 at 9 50 34 PM

I decided to modify the __init__.py directly to add the imports and I commented out the lazy_import function since it was upset about the namespace collisions occurring. I minimally tested the library afterwards and it seemed to work while also supporting much more IDE features. I do believe that most developers would not do something like this however and thus their local development experience would be considerably worse.

Screen Shot 2022-01-31 at 9 51 09 PM

This is what the IDE "experience" was like after modifying the __init__.py file

Screen Shot 2022-01-31 at 9 51 03 PM

I'm not sure what the best way to improve the IDE experience would be, while also keeping lazy_imports, but I do believe it is a worthwhile thing to do. A different python repository had a discussion on this very issue which maybe useful to you.

pulumi/pulumi#7367

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions