Differences

This shows you the differences between two versions of the page.

Link to this comparison view

ic:resurse:python [2023/10/02 00:09]
razvan.smadu [Python3 Crash Course]
ic:resurse:python [2023/10/02 00:10] (current)
razvan.smadu [Python3 Crash Course]
Line 264: Line 264:
 Exemple: Exemple:
 <code python> <code python>
-from typing import List, Sequence, Tuple, TypeVar+from typing import ​Dict, List, Sequence, Tuple, TypeVar
  
 my_string: str = "hello world" ​ # A variable storing a string my_string: str = "hello world" ​ # A variable storing a string
Line 281: Line 281:
 def first(l: Sequence[T]) -> T:  # A generic function def first(l: Sequence[T]) -> T:  # A generic function
     return l[0]     return l[0]
 +
 +# Type alias
 +MyCustomType = Dict[str, List[Tuple[int,​ int]]]
 </​code>​ </​code>​
  
ic/resurse/python.1696194542.txt.gz · Last modified: 2023/10/02 00:09 by razvan.smadu
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0