✏ Fix typo in `python-types.md` (#5116)

This commit is contained in:
Marcelo Trylesinski 2022-08-18 18:04:33 +02:00 committed by GitHub
parent d268eb2011
commit 46f5091c9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -326,7 +326,7 @@ If you are using a Python version below 3.10, here's a tip from my very **subjec
Both are equivalent and underneath they are the same, but I would recommend `Union` instead of `Optional` because the word "**optional**" would seem to imply that the value is optional, and it actually means "it can be `None`", even if it's not optional and is still required. Both are equivalent and underneath they are the same, but I would recommend `Union` instead of `Optional` because the word "**optional**" would seem to imply that the value is optional, and it actually means "it can be `None`", even if it's not optional and is still required.
I think `Union[str, SomeType]` is more explicit about what it means. I think `Union[SomeType, None]` is more explicit about what it means.
It's just about the words and names. But those words can affect how you and your teammates think about the code. It's just about the words and names. But those words can affect how you and your teammates think about the code.