New submission from Shantanu <hauntsani...@gmail.com>:

The dunder methods on decimal.Decimal accept an extra context argument in the 
pure Python version which the C version does not (violating PEP 399).

This came up in https://github.com/python/typeshed/pull/3633, where Sebastian 
provided the following summary of the issue:
```
Python 3.8.1 (default, Jan 14 2020, 19:41:43) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from _decimal import Decimal as CDecimal
>>> from _pydecimal import Decimal as PyDecimal
>>> PyDecimal(1).__abs__(None)
Decimal('1')
>>> CDecimal(1).__abs__(None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: expected 0 arguments, got 1
```

----------
components: Library (Lib)
messages: 362443
nosy: hauntsaninja
priority: normal
severity: normal
status: open
title: decimal differs between pure Python and C implementations

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

Reply via email to