Is asking if a and None (the singleton value) point to the same memory space. It's not asking if they're equivalent; it's asking if they are the same actual thing.
Thus, is is not the same as equivalence how we usually think of it (double equals).
That's why setting a default value of None is so useful in function definitions: there's only one None and your function value either is that thing or it's not. It's never going to be like None enough to pass for it.
10
u/erewok Jun 23 '14 edited Jun 23 '14
Correct me if I'm wrong here, but I thought:
Is asking if
aandNone(the singleton value) point to the same memory space. It's not asking if they're equivalent; it's asking if they are the same actual thing.Thus,
isis not the same as equivalence how we usually think of it (double equals).That's why setting a default value of
Noneis so useful in function definitions: there's only oneNoneand your function value either is that thing or it's not. It's never going to be likeNoneenough to pass for it.