New submission from Hameer Abbasi <einstein.edi...@gmail.com>:

Minimal reproducer:

>>> class A:
...     def __round__(self):
...         return NotImplemented
...
>>> round(A())
NotImplemented

Should give a TypeError.

This can be useful when deciding, for example, if a given a.dtype implements 
round based on the dtype

----------
components: Interpreter Core
messages: 365323
nosy: Hameer Abbasi
priority: normal
severity: normal
status: open
title: __round__ doesn't behave well with return NotImplemented
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40117>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to