This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author neologix
Recipients kushal.das, nedbat, neologix, pitrou, trent, vstinner
Date 2013-05-07.06:48:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAH_1eM3ZQ5b7VsN72rroaWmhj1UBjB6MdSZTvftHVUiLHcYswg@mail.gmail.com>
In-reply-to <1367879594.22.0.946391491649.issue17914@psf.upfronthosting.co.za>
Content
> I also vote +1 for returning None when the information is unknown.

I still don't like it.
If a function returns a number of CPU, it should either return an
integer >= 1, or raise an exception.
None is *not* an integer.

And returning an exception is IMO useles, since the user can't do
anything with anyway, other than fallback to 1.

> Just write "os.cpu_count() or 1" if you need 1 when the count is unknown ;-)

os.cpu_count() or 1 is an ugly idiom.

> See also #17444, Trent Nelson wrote an implementation of os.cpu_count().

I don't see exactly what this C implementation brings over the one in
multiprocessing (which is written in Python)?
History
Date User Action Args
2013-05-07 06:48:45neologixsetrecipients: + neologix, pitrou, vstinner, nedbat, trent, kushal.das
2013-05-07 06:48:45neologixlinkissue17914 messages
2013-05-07 06:48:45neologixcreate