Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for shortcut (0.19 sec)

  1. docs/en/docs/python-types.md

    Using `Optional[str]` instead of just `str` will let the editor help you detecting errors where you could be assuming that a value is always a `str`, when it could actually be `None` too.
    
    `Optional[Something]` is actually a shortcut for `Union[Something, None]`, they are equivalent.
    
    This also means that in Python 3.10, you can use `Something | None`:
    
    === "Python 3.10+"
    
        ```Python hl_lines="1"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 17K bytes
    - Viewed (0)
Back to top