Follow-on to PR #3254, to address user code breakages. (#3263)

* Restoring `const` removed from pytypes.h in PR #3254, adding tests reflective of user code that breaks when those `const` are removed.

* clang-tidy NOLINTs (and one collateral fix).

* Inserting PYBIND11_CONST_FOR_STRICT_PLATFORMS

* Trying `defined(__APPLE__)`

* Trying again: `auto it` for strict platforms.

* Adding NOLINTNEXTLINE(bugprone-macro-parentheses), expanding comments.

* Labeling all changes with `PR #3263`, for easy reference, and to make it easy to undo these changes if we decide to do so in the future.
This commit is contained in:
Ralf W. Grosse-Kunstleve
2021-09-12 19:53:26 -07:00
committed by GitHub
parent 9978ed588b
commit 6c65ab5950
4 changed files with 58 additions and 3 deletions

View File

@@ -623,6 +623,12 @@ def test_weakref(create_weakref, create_weakref_with_callback):
assert callback.called
def test_cpp_iterators():
assert m.tuple_iterator() == 12
assert m.dict_iterator() == 305 + 711
assert m.passed_iterator(iter((-7, 3))) == -4
def test_implementation_details():
lst = [39, 43, 92, 49, 22, 29, 93, 98, 26, 57, 8]
tup = tuple(lst)