Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
| it:programmiersprache:python:typehints [23.08.2026 21:07] – marsch | it:programmiersprache:python:typehints [23.08.2026 21:33] (aktuell) – marsch | ||
|---|---|---|---|
| Zeile 5: | Zeile 5: | ||
| - | Generic Types | + | ===== Standard Typen ===== |
| + | int | ||
| + | str | ||
| + | ... | ||
| + | |||
| + | |||
| + | ===== Benutzerdefinierte Typen ===== | ||
| + | |||
| + | Check | ||
| <code python> | <code python> | ||
| - | check TypeVar ..... # < 3.12 | + | from typing import NewType |
| - | def funktion[T](items: | + | RGB = NewType(" |
| + | </ | ||
| + | |||
| + | Check | ||
| + | <code python> | ||
| + | from typing import TypeVar | ||
| + | |||
| + | TypeVar ..... # < 3.12 | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Generische Typen ===== | ||
| + | |||
| + | <code python> | ||
| + | def funktion[T](items: | ||
| </ | </ | ||