1

I'm developing a Python package with the following structure:

module_name
  |- __init__.py
  |- app.py
  |- filesystem
     - __init__.py
     - extend_filesystem.py

The extend_filesystem.py contains the following function with the displayed signature:

function signature

When I try to import the module inside app.py VScode doesn't show any useful information (like parameters hints or function's description)

intellisen screenshot

I installed the Pylance extension, I set it as server Language and set the Python's interpreter (Python 3.7.1 32-bit in my case) for the entire workspace

I'm using Vscode Version 1.54.2

Edit: within the same directory, the intellisense system shows all the information. So, how can I extend this behaviour in the entire package folder?

2

1 Answer 1

0

According to the information you provided, I tested it in VS Code, and you could refer to the following:

enter image description here

  1. When I use Jedi (default) as the language service of python:

    enter image description here

    In order to ensure that the code can run, we need to use:

    from filesystem.extend_filesystem import extend_file

  2. When I use Pylance as a language service for python:

    enter image description here

    In order to ensure that the code can run, we need to use:

    import sys 
    sys.path.append("./")
    
    from emo.filesystem.extend_filesystem import extend_file
    

In addition, it is recommended that you distinguish between the file name and the function name to avoid confusion during import.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.