[Tutor] Why begin a function name with an underscore

Steven D'Aprano steve at pearwood.info
Fri Aug 31 03:27:53 CEST 2012


On 31/08/12 06:57, eryksun wrote:
> On Thu, Aug 30, 2012 at 2:07 PM, Peter Otten<__peter__ at web.de>  wrote:
>>
>> Allowing floats for a primality test is a can of worms anyway. You will
>> inevitably run out of significant digits:
>
> Allowing floats can also lead to type errors for operations that
> require an integral type, but at least they're easier to catch with
> proper testing. For example, line 323 will raise a TypeError if n is a
> float:

Good catch, thank you. And that's why the module is still in alpha.



-- 
Steven


More information about the Tutor mailing list