How do Fractions convert to int?

Steven D'Aprano steve+comp.lang.python at pearwood.info
Tue Mar 13 08:06:23 EDT 2018


On Tue, 13 Mar 2018 12:40:26 +0100, Robin Koch wrote:

> Am 13.03.2018 um 12:16 schrieb Steven D'Aprano:
> 
>> How do Fractions convert to ints when they have no __int__ method?
> 
> It uses __trunc__:

Ah, thanks!


-- 
Steve




More information about the Python-list mailing list