Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic ItemsView, KeysView, ValuesView rendered with pybind11-master #209

Closed
auscompgeek opened this issue Feb 25, 2024 · 1 comment · Fixed by #211
Closed

Generic ItemsView, KeysView, ValuesView rendered with pybind11-master #209

auscompgeek opened this issue Feb 25, 2024 · 1 comment · Fixed by #211
Labels
bug Something isn't working

Comments

@auscompgeek
Copy link
Contributor

Running the tests today results in this unusual output:

diff --git a/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi b/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi
index c39135b..2b9f4d3 100644
--- a/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi
+++ b/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi
@@ -3,12 +3,24 @@ from __future__ import annotations
 import typing
 
 __all__ = [
+    "ItemsView",
+    "KeysView",
     "MapStringComplex",
+    "ValuesView",
     "VectorPairStringDouble",
     "get_complex_map",
     "get_vector_of_pairs",
 ]
 
+class ItemsView:
+    def __iter__(self: typing.ItemsView) -> typing.Iterator: ...
+    def __len__(self: typing.ItemsView) -> int: ...
+
+class KeysView:
+    def __contains__(self: typing.KeysView, arg0: typing.Any) -> bool: ...
+    def __iter__(self: typing.KeysView) -> typing.Iterator: ...
+    def __len__(self: typing.KeysView) -> int: ...
+
 class MapStringComplex:
     def __bool__(self) -> bool:
         """
@@ -28,9 +40,13 @@ class MapStringComplex:
         Return the canonical string representation of this map.
         """
     def __setitem__(self, arg0: str, arg1: complex) -> None: ...
-    def items(self) -> typing.ItemsView[str, complex]: ...
-    def keys(self) -> typing.KeysView[str]: ...
-    def values(self) -> typing.ValuesView[complex]: ...
+    def items(self) -> typing.ItemsView: ...
+    def keys(self) -> typing.KeysView: ...
+    def values(self) -> typing.ValuesView: ...
+
+class ValuesView:
+    def __iter__(self: typing.ValuesView) -> typing.Iterator: ...
+    def __len__(self: typing.ValuesView) -> int: ...
 
 class VectorPairStringDouble:
     __hash__: typing.ClassVar[None] = None
@sizmailov
Copy link
Owner

I believe it's due to recent changes in pybind11 pybind/pybind11#4985

@sizmailov sizmailov changed the title Weird output with pybind11 master Generic ItemsView, KeysView, ValuesView rendered in pybind11-master Mar 4, 2024
@sizmailov sizmailov changed the title Generic ItemsView, KeysView, ValuesView rendered in pybind11-master Generic ItemsView, KeysView, ValuesView rendered with pybind11-master Mar 4, 2024
@sizmailov sizmailov added the bug Something isn't working label Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants