Python 3 on macOS: how to set process affinity

I am trying to restrict the number of CPUs used by Python (for benchmarking & to see if it speeds up my program). I have found a few Python modules for achieving this ('os', 'affinity', 'psuti...