Message188624
> 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)? |
|
Date |
User |
Action |
Args |
2013-05-07 06:48:45 | neologix | set | recipients:
+ neologix, pitrou, vstinner, nedbat, trent, kushal.das |
2013-05-07 06:48:45 | neologix | link | issue17914 messages |
2013-05-07 06:48:45 | neologix | create | |
|