Skip to content

Mark optional params as Optional - #5128

Merged
hramezani merged 2 commits into
pydantic:1.10.X-fixesfrom
JensHeinrich:fix/Typing
Mar 2, 2023
Merged

hramezani merged 2 commits into
pydantic:1.10.X-fixesfrom
JensHeinrich:fix/Typing

Conversation

@JensHeinrich

@JensHeinrich JensHeinrich commented Mar 1, 2023 •

Copy link
Copy Markdown
Contributor

Mark parameters as Optional if they are
skip change file check

@JensHeinrich

Copy link
Copy Markdown
Contributor Author

Yes, those annoy me because my editor is too angry

@JonathanPlasse

Copy link
Copy Markdown

You should remove implicit_optional = true from mypy configuration.

@JensHeinrich

Copy link
Copy Markdown
Contributor Author

You should remove implicit_optional = true from mypy configuration.

Pretty sure that won't work as my editor is using pyright

@JensHeinrich

Copy link
Copy Markdown
Contributor Author

You should remove implicit_optional = true from mypy configuration.

Pretty sure that won't work as my editor is using pyright

And I do like to do things correctly

@JonathanPlasse

Copy link
Copy Markdown

It should be removed because you are removing implicit optional.
This is present because there were implicit optional.

@JensHeinrich

Copy link
Copy Markdown
Contributor Author

It should be removed because you are removing implicit optional. This is present because there were implicit optional.

I just had a look for this option, and according to this article mypy disallows implicit optional since version 0.99.
The implicit optional type has been removed from PEP 484 in python/peps#689

Comment thread pydantic/fields.py Outdated
@hramezani
hramezani merged commit 7f3b754 into pydantic:1.10.X-fixes Mar 2, 2023
@hramezani

Copy link
Copy Markdown
Contributor

Thanks @JensHeinrich

@JensHeinrich
JensHeinrich deleted the fix/Typing branch March 7, 2023 06:54
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

Successfully merging this pull request may close these issues.

5 participants