Message286441
| Author | steven.daprano |
|---|---|
| Recipients | christian.heimes, facundobatista, mark.dickinson, martin.panter, rhettinger, serhiy.storchaka, steven.daprano |
| Date | 2017-01-29.11:01:18 |
| SpamBayes Score | -1.0 |
| Marked as misclassified | Yes |
| Message-id | <20170129110054.GM7345@ando.pearwood.info> |
| In-reply-to | <1485678185.45.0.74340746494.issue18842@psf.upfronthosting.co.za> |
| Content | |
|---|---|
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. |
|
| History | |||
|---|---|---|---|
| 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 | |