You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When working on Visual Studio Code, the hint of the type isn't very helpful. Could we make it better ? can I help doing that ?
Example:
from mongoengine import Document, StringField
class User(Document):
name = StringField(required=True)
surname = StringField(required=False)
user = User(name="John", surname="Wick")
user.name
user.surname
The proposition of Visual Studio Code type are:
(variable) name: StringField | Unknown
(variable) surname: StringField | Unknown
Yet, the print give a really practical type:
print(type(user.name)) -> <class 'str'>
I want make my code more robust and be able to see that on the values:
(variable) name: str
(variable) surname: str | None
The information that it can, or not, be None, can help a lot.
The text was updated successfully, but these errors were encountered:
When working on Visual Studio Code, the hint of the type isn't very helpful. Could we make it better ? can I help doing that ?
Example:
The proposition of Visual Studio Code type are:
(variable) name: StringField | Unknown
(variable) surname: StringField | Unknown
Yet, the print give a really practical type:
I want make my code more robust and be able to see that on the values:
(variable) name: str
(variable) surname: str | None
The information that it can, or not, be None, can help a lot.
The text was updated successfully, but these errors were encountered: