Antoine Pitrou added the comment:

> And I maintain it's an ugly idiom ;-)
> Since the user can't do anything except falling back to 1,
> os.cpu_count() should always return a positive number (1 by default).

The user can also raise an error. For example, if I'm writing a
benchmark to measure per-core scaling performance, I would like to bail
out if I can't calculate the number of cores (rather than report
incorrect results).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17914>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to