Returns 1 if `o` is considered a mapping for the purposes of Flatten(). Returns 0 otherwise. Returns -1 if an error occurred.
| 214 | // Returns 0 otherwise. |
| 215 | // Returns -1 if an error occurred. |
| 216 | int IsMappingHelper(PyObject* o) { |
| 217 | static auto* const check_cache = new CachedTypeCheck([](PyObject* to_check) { |
| 218 | return IsInstanceOfRegisteredType(to_check, "Mapping"); |
| 219 | }); |
| 220 | if (PyDict_Check(o)) return true; |
| 221 | return check_cache->CachedLookup(o); |
| 222 | } |
| 223 | |
| 224 | // Returns 1 if `o` is considered a mapping view for the purposes of Flatten(). |
| 225 | // Returns 0 otherwise. |
no test coverage detected