10 ms·
For the actual type annotations themselves, the official docs are great: https://docs.python.org/3/library/typing.html https://docs.python.org/3/library/typing.
by aodin 6y ago
For the actual type annotations themselves, the official docs are great: https://docs.python.org/3/library/typing.html https://docs.python.org/3/library/typing.html
Know that the signatures vary with version, so select the correct one.
To check these annotations, you'll need a third-party type checker somewhere in your build process. I use pylance with VS Code, as it can detect errors as I type: https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance https://marketplace.visualstudio.com/items?itemName=ms-pytho...
- tgb 6y agoThis doesn't seem like an ideal introduction. I don't think it actually covers type checking at all (besides the note at the top) since that's relegated to third parties.