mirror of
https://github.com/davrot/pytutorial.git
synced 2025-04-18 21:26:41 +02:00
Update README.md
Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com>
This commit is contained in:
parent
c67be1599e
commit
5f2573bb7b
1 changed files with 15 additions and 1 deletions
|
@ -56,11 +56,25 @@ def this_is_a_function(a: int, b: int = 8) -> tuple[int, int]:
|
||||||
return a, b
|
return a, b
|
||||||
```
|
```
|
||||||
|
|
||||||
Please note, that there is a difference how type annotations worked for older version. I will cover only Python 3.10 and newer.
|
Please note, that there is a difference how type annotations worked for older version. I will cover only Python 3.10 and newer. The official documentation can be found [here](https://docs.python.org/3/library/typing.html).
|
||||||
|
|
||||||
## MyPy under VS Code
|
## MyPy under VS Code
|
||||||
(also the header packages)
|
(also the header packages)
|
||||||
|
|
||||||
|
## Built-in types
|
||||||
|
### Simple types
|
||||||
|
### Any type (Special type indicating an unconstrained type.)
|
||||||
|
|
||||||
|
```python
|
||||||
|
from typing import Any
|
||||||
|
a: Any = 0
|
||||||
|
b: float = 0.0
|
||||||
|
a = b
|
||||||
|
```
|
||||||
|
|
||||||
|
### Generic types
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue