[issue17914] add os.cpu_count()

Ned Batchelder report at bugs.python.org
Sat May 11 13:51:08 CEST 2013


Ned Batchelder added the comment:

A few small points:

Use `num is None` instead of `num == None`.

Use `isinstance(cpus, int)` rather than `type(cpus) is int`.

And this I think will throw an exception in Python 3: `cpus >= 1 or cpus == None`, because you can't compare None to 1.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17914>
_______________________________________


More information about the Python-bugs-list mailing list