pybind11/include
Paul-Edouard Sarlin 56e69a20a5
Print key in KeyError in map.__getitem__/__delitem__ (#5397)
* Print key in map.getitem/delitem KeyError

* Add tests

* Fix tests

* Make robust

* Make clang-tidy happy

* Return a Python str

* Show beginning and end of the message

* Avoid implicit conversion

* Split out `format_message_key_error_key_object()` to reduce amount of templated code.

* Use `"✄✄✄"` instead of `"..."`

Also rename variable to `cut_length`, to not get into even/odd issues with the meaning of "half".

---------

Co-authored-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>
2024-10-08 10:49:35 -07:00
..
pybind11 Print key in KeyError in map.__getitem__/__delitem__ (#5397) 2024-10-08 10:49:35 -07:00