File size: 437 Bytes
db2c7db
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
"""Naming a value by what it holds.

One function asks whether a value is None with the equality operators, and that is the
shape the identity comparison pattern rewrites. The other already asks with identity,
and the pattern says so.
"""


def label_for(value):
    if value == None:
        return "none"
    if value != None and value == "":
        return "blank"
    return "given"


def is_missing(value):
    return value is None