Message370190
| Author |
mark.dickinson |
| Recipients |
Arfrever, alex, barry, docs@python, eric.snow, ethan.furman, mark.dickinson, mjacob, ncoghlan, python-dev, rhettinger, serhiy.storchaka, vstinner |
| Date |
2020年05月28日.11:07:35 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1590664055.45.0.271220474519.issue17576@roundup.psfhosted.org> |
| In-reply-to |
| Content |
> The other way to solve my problem would be to provide an operator module function (operator.as_float?) that does a duck-typed conversion of an arbitrary Python object to a float.
This does feel like the *right* solution to me. See #40801 and the linked PR. If we can do something like this, I'd be happy to drop the expectation that __float__ return something of exact type float, and similarly for __index__. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2020年05月28日 11:07:35 | mark.dickinson | set | recipients:
+ mark.dickinson, barry, rhettinger, ncoghlan, vstinner, Arfrever, alex, docs@python, ethan.furman, python-dev, eric.snow, serhiy.storchaka, mjacob |
| 2020年05月28日 11:07:35 | mark.dickinson | set | messageid: <1590664055.45.0.271220474519.issue17576@roundup.psfhosted.org> |
| 2020年05月28日 11:07:35 | mark.dickinson | link | issue17576 messages |
| 2020年05月28日 11:07:35 | mark.dickinson | create |
|