Message286441
On Sun, Jan 29, 2017 at 08:23:05AM +0000, Martin Panter wrote:
> Why do you name the methods is_finite() etc with underscores, when the
> existing methods math.isfinite() etc do not have underscores? Seems it
> would add unnecessary confusion.
The idea is to enable duck-typing between float and Decimal. Instead of:
if isinstance(x, float):
math.isfinite(x)
else:
x.is_finite()
we can just say
x.is_finite()
on both floats and decimals. |
|
Date |
User |
Action |
Args |
2017-01-29 11:01:18 | steven.daprano | set | recipients:
+ steven.daprano, rhettinger, facundobatista, mark.dickinson, christian.heimes, martin.panter, serhiy.storchaka |
2017-01-29 11:01:18 | steven.daprano | link | issue18842 messages |
2017-01-29 11:01:18 | steven.daprano | create | |
|