Author neologix
Recipients Yogesh.Chaudhari, dilettant, ezio.melotti, kushal.das, nedbat, neologix, pitrou, r.david.murray, serhiy.storchaka, trent, vstinner
Date 2013-05-14.05:36:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAH_1eM0z5MWi_zLUAa5jZJSRihyH-9rANWKiXL77rB93XKCJ+w@mail.gmail.com>
In-reply-to <1368480080.4048.8.camel@fsol>
Content
> Well, they can be wrong sometimes, too :-)

Indeed, as can I ;-)

> The patch doesn't seem to rely on the glibc, so we are fine here.
> Or do the other libs work likewise?

sysconf(_SC_NPROCESSORS_CONF) is implemented with the above function
in the glibc.

For other Unix systems apparently they use the sysctl() syscall, and I
don't *think* it can fail to return the number of CPUs. So the only
platforms where it could in theory fail are things like Cygwin, etc.

>
>> And the DSL processor takes care of the rest.
>>
>> What does this become if your return object isn't typed?
>
> It's typed, just the type is "int or None". I'm sure some
> statically-typed languages are able to express this (OCaml? Haskell?).

I recently started learning Haskell. You have Either and Maybe that
could fall into that category.

> Anyway, I don't mind whether it's None or 0 or -42. But let's not hide
> the information.

I liked your suggestion of making it an enum:

>>> os.cpu_count()
<CPUCount.UnknownCount: 42>

Nah, None is fine to me!
History
Date User Action Args
2013-05-14 05:36:54neologixsetrecipients: + neologix, pitrou, vstinner, nedbat, trent, ezio.melotti, r.david.murray, serhiy.storchaka, kushal.das, dilettant, Yogesh.Chaudhari
2013-05-14 05:36:54neologixlinkissue17914 messages
2013-05-14 05:36:54neologixcreate