mirror of
https://github.com/python/cpython.git
synced 2025-10-17 12:18:23 +00:00
Issue #16431: Finally, consider all permutations.
This commit is contained in:
parent
9cfa1ff891
commit
0f82b76b57
2 changed files with 25 additions and 10 deletions
|
@ -2338,14 +2338,14 @@ PyDecType_FromFloat(PyTypeObject *type, PyObject *v,
|
|||
return dec;
|
||||
}
|
||||
|
||||
/* Return a new PyDecObject (subtype) from a Decimal. */
|
||||
/* Return a new PyDecObject or a subtype from a Decimal. */
|
||||
static PyObject *
|
||||
PyDecType_FromDecimalExact(PyTypeObject *type, PyObject *v, PyObject *context)
|
||||
{
|
||||
PyObject *dec;
|
||||
uint32_t status = 0;
|
||||
|
||||
if (type == Py_TYPE(v)) {
|
||||
if (type == &PyDec_Type && PyDec_CheckExact(v)) {
|
||||
Py_INCREF(v);
|
||||
return v;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue