| 558 | } |
| 559 | |
| 560 | static bool py_long_to_int64(PyObject *value, int64_t *out) { |
| 561 | int overflow = 0; |
| 562 | long long converted = PyLong_AsLongLongAndOverflow(value, &overflow); |
| 563 | if (converted == -1 && PyErr_Occurred()) { |
| 564 | return false; |
| 565 | } |
| 566 | if (overflow != 0) { |
| 567 | PyErr_SetString(PyExc_OverflowError, |
| 568 | "integer out of range for int64 fastpath"); |
| 569 | return false; |
| 570 | } |
| 571 | *out = static_cast<int64_t>(converted); |
| 572 | return true; |
| 573 | } |
| 574 | |
| 575 | static bool can_use_list_sequence_fastpath(PyObject **items, Py_ssize_t size, |
| 576 | uint8_t type_id) { |
no outgoing calls
no test coverage detected