[issue17914] add os.cpu_count()
R. David Murray
report at bugs.python.org
Tue May 7 14:34:39 CEST 2013
R. David Murray added the comment:
As for why to not return 1, I can imagine code that checks cpu_count, and only if it returns the "don't know" result would it invoke some more expensive method of determining the CPU count on platforms that cpu_count doesn't support. Since the os module is the home for "close to the metal" (well, OS) functions, I agree that it does not make sense to throw away the information that cpu_count can't actually determine the CPU count. Contrawise, I could see the multiprocessing version returning 1, since it is a higher level API and os.cpu_count would be available for those wanting the "don't know" info.
----------
nosy: +r.david.murray
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17914>
_______________________________________
More information about the Python-bugs-list
mailing list