The status counting loop iterated over every key of the processcount dict, so
'pid_max' was assigned the number of processes whose status is 'pid_max', ie 0.
It was set to the system value on the line above, and 'total' and 'thread' are
recomputed after the loop, so pid_max was the only casualty: /api/4/processcount
reported 0 while /proc/sys/kernel/pid_max was 4194304.
The status was also matched with 'is', which compares identity. It only worked
by accident, because CPython interns identifier-like literals such as 'running'
and 'sleeping'. Any status that is not interned, or not an identifier such as
'disk-sleep', would never match its key.
Count the two status keys only, and compare with '=='. pid_max now keeps the
value read from the system, and stays None when it can not be read (non Linux),
as documented by the property and as initialised by reset_processcount().