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

Pyright does not infer types for wtforms #848

Open
ilkiri23 opened this issue Jul 3, 2024 · 1 comment
Open

Pyright does not infer types for wtforms #848

ilkiri23 opened this issue Jul 3, 2024 · 1 comment

Comments

@ilkiri23
Copy link

ilkiri23 commented Jul 3, 2024

I'm trying to create a FolderForm instance, but pyright infers the type as Any
Also tried to install types-WTForms to solve the problem, but it didn't work for me

Actual Behavior

from wtforms import Form, StringField

class FolderForm(Form):
    name = StringField('Name')
 
form = FolderForm() # form is Any
Screenshot 2024-06-20 at 22 53 10

Expected Behavior

form has the FolderForm type

Environment

  • Python version: 3.12.4
  • WTForms version: 3.1.2
  • types-WTForms version: 3.1.0.20240425
@ultinvincible
Copy link

I'm having the same problem with the VSCode extension Pylance, which uses Pyright.
Versions 24.4.101 pre-release and earlier do not have this problem.
Versions 24.4.102 pre-release, which updates Pyright from 1.1.358 to 1.1.359, and later have this problem.

  • Python version: 3.12.4
  • WTForms==3.1.2
  • types-WTForms==3.1.0.20240425

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

No branches or pull requests

2 participants