Type Annotations Flashcards
1
Q
integer
A
int
2
Q
float
A
float
3
Q
function
A
callable
4
Q
list of any type
A
list[any]
5
Q
any
A
any
6
Q
string
A
str
7
Q
True/False
A
bool
8
Q
null
A
None
9
Q
list of strings
A
list[str]
10
Q
list of integers
A
list[int]
11
Q
list of floats
A
list[float]
12
Q
list of lists
A
list[list[any]]
13
Q
list of lists of strings
A
list[list[str]]
14
Q
tuple with an int, string, int
A
tuple[int, str, int]
15
Q
tuple with a list of strings and a list of floats
A
tuple[list[str], list[float]]
16
Q
list of tuple of 3 string
A
list[tuple[str, str, str]]
17
Q
dictionary of string and integer
A
dict[str, int]
18
Q
dictionary of integer and list of floats
A
dict[int, list[float]]
19
Q
leaf labelled tree (LLT)
A
int | list[‘LLT’]
20
Q
or
A
|
21
Q
default parameter
A
type = default
22
Q
class
A
name of class