[issue17914] add os.cpu_count()

Serhiy Storchaka report at bugs.python.org
Sat May 11 15:10:34 CEST 2013


Serhiy Storchaka added the comment:

> Since the user can't do anything except falling back to 1,
> os.cpu_count() should always return a positive number (1 by default).

In general I agree with you. Actually the os module should contains two functions: cpu_count() which fallbacks to 1 and is_cpu_counting_supported() for rare need. But this looks even more ugly and I choose single function even if in most cases I need use strange idiom.

----------

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


More information about the Python-bugs-list mailing list