Type Annotations Flashcards

1
Q

integer

A

int

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

float

A

float

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

function

A

callable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

list of any type

A

list[any]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

any

A

any

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

string

A

str

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

True/False

A

bool

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

null

A

None

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

list of strings

A

list[str]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

list of integers

A

list[int]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

list of floats

A

list[float]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

list of lists

A

list[list[any]]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

list of lists of strings

A

list[list[str]]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

tuple with an int, string, int

A

tuple[int, str, int]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

tuple with a list of strings and a list of floats

A

tuple[list[str], list[float]]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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’]

21
Q

default parameter

A

type = default

22
Q

class

A

name of class