Message342140
| Author | pablogsal |
|---|---|
| Recipients | Scaler, pablogsal |
| Date | 2019-05-10.22:12:35 |
| SpamBayes Score | -1.0 |
| Marked as misclassified | Yes |
| Message-id | <1557526355.9.0.424205584653.issue36879@roundup.psfhosted.org> |
| In-reply-to |
| Content | |
|---|---|
round() delegates to class.__round__, so what's happening here is that numpy's float implements __round__ in a way it returns a float. There is no restriction on what the class can return: >>> class A: ... def __round__(self): ... return "Oh, no!" ... >>> round(A()) 'Oh, no!' Making additional restrictions is backwards incompatible. Maybe we should add something in the docs regarding the no-restriction point. |
|
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2019-05-10 22:12:35 | pablogsal | set | recipients: + pablogsal, Scaler |
| 2019-05-10 22:12:35 | pablogsal | set | messageid: <1557526355.9.0.424205584653.issue36879@roundup.psfhosted.org> |
| 2019-05-10 22:12:35 | pablogsal | link | issue36879 messages |
| 2019-05-10 22:12:35 | pablogsal | create | |