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

Recent versions of VS Code are reporting Pylance errors #533

Open
ataylor32 opened this issue Sep 13, 2024 · 0 comments
Open

Recent versions of VS Code are reporting Pylance errors #533

ataylor32 opened this issue Sep 13, 2024 · 0 comments

Comments

@ataylor32
Copy link

Visual Studio Code used to have no issues with the following code:

SOME_SETTING = env("SOME_SETTING", default="fallback")

But in recent versions (1.93.1, for example), "fallback" is underlined in red. Hovering over it shows this:

Argument of type "Literal['fallback']" cannot be assigned to parameter "default" of type "NoValue" in function "__call__"
  "Literal['fallback']" is not assignable to "NoValue" Pylance(reportArgumentType)

Similarly, Visual Studio Code used to have no issues with the following code:

DATABASES = {
    "default": env.db("DATABASE_URL_default", default="sqlite:///db.sqlite3"),
}

But in recent versions, "sqlite:///db.sqlite3" is underlined in red. Hovering over it shows this:

Argument of type "Literal['sqlite:///db.sqlite3']" cannot be assigned to parameter "default" of type "NoValue" in function "db_url"
  "Literal['sqlite:///db.sqlite3']" is not assignable to "NoValue" Pylance(reportArgumentType)

I don't know if the issue is with django-environ or Pylance or Pyright.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant