[issue36879] bug with round() and "numpy floats"
Mark Dickinson <dickinsm@gmail.com> added the comment:
Maybe we should add something in the docs regarding the no-restriction point.
IMO, the docs are clear enough (and also long enough) already here. Just as with most other magic methods, classes from third-party packages can return whatever they like. It doesn't seem worth adding specific disclaimers about this everywhere that a magic method might be used. Otherwise, we should also add corresponding disclaimers about `__floor__`, `__ceil__`, `__trunc__`, `__pow__`, and so on, and I think that would just introduce an increase in documentation size without any overall increase in clarity or usefulness. I'd prefer to stick to documenting that there _is_ a restriction where that's true (e.g., `__index__` or `__hash__`). ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue36879> _______________________________________
participants (1)
-
Mark Dickinson