Skip to content

Commit

Permalink
✏ Fix typo in python-types.md (#5116)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kludex committed Aug 18, 2022
1 parent d268eb2 commit 46f5091
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/en/docs/python-types.md
Expand Up @@ -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.

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.

Expand Down

0 comments on commit 46f5091

Please sign in to comment.