Simplify defaultdict.__or__ (#18931)
This commit is contained in:
parent
c00c86b904
commit
1dd3794b19
@ -2133,12 +2133,8 @@ defdict_repr(defdictobject *dd)
|
|||||||
static PyObject*
|
static PyObject*
|
||||||
defdict_or(PyObject* left, PyObject* right)
|
defdict_or(PyObject* left, PyObject* right)
|
||||||
{
|
{
|
||||||
int left_is_self = PyObject_IsInstance(left, (PyObject*)&defdict_type);
|
|
||||||
if (left_is_self < 0) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
PyObject *self, *other;
|
PyObject *self, *other;
|
||||||
if (left_is_self) {
|
if (PyObject_TypeCheck(left, &defdict_type)) {
|
||||||
self = left;
|
self = left;
|
||||||
other = right;
|
other = right;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user