bpo-41974: Remove complex.__float__, complex.__floordiv__, etc (GH-22593)

Remove complex special methods __int__, __float__, __floordiv__,
__mod__, __divmod__, __rfloordiv__, __rmod__ and __rdivmod__
which always raised a TypeError.
This commit is contained in:
Serhiy Storchaka 2020-10-09 14:14:37 +03:00 committed by GitHub
parent 48f305fd12
commit e2ec0b27c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 81 additions and 66 deletions

View file

@ -522,7 +522,7 @@ formatlong(PyObject *v, int flags, int prec, int type)
PyErr_Format(PyExc_TypeError,
"%%%c format: %s is required, not %.200s", type,
(type == 'o' || type == 'x' || type == 'X') ? "an integer"
: "a number",
: "a real number",
Py_TYPE(v)->tp_name);
return NULL;
}