Uh oh!
There was an error while loading. Please reload this page.
fix: removing typing and duplicate class_ for KeysView/ValuesView/ItemsView. - #4985
Conversation
rwgk
commented
Dec 20, 2023
Thanks a lot @hczhai! I'll try global testing with this PR, too. |
rwgk
commented
Dec 21, 2023
I succeeded only now to initiate the global testing for this PR (after two failed attempts due to unrelated issues), it'll be another 8 hours or so before I have the results. Assuming the global testing passes (seems very likely to me), I think merging this PR is our best alternative. It's better than the state before #4353 (reduced code complexity and runtime overhead, sidesteps #3986) and fixes #4529. @hczhai what do you think about transferring a few selected tests from #4972 and #4983 here? This is in case someone wants to add the |
Global testing passed, with diffs in only one stubgen test again (same test as before). (Internal test id for my own reference: OCL:592563041:BASE:592858163:1703173245690:a9e29695) The diff is as expected: -class ItemsView[int, object]:+class ItemsView:
def __init__(self, *args, **kwargs) -> None: ...
def __iter__(self) -> Iterator: ...
def __len__(self) -> int: ...
-class ItemsView[str, object]:+class KeysView:
def __init__(self, *args, **kwargs) -> None: ...
- def __iter__(self) -> Iterator: ...- def __len__(self) -> int: ...--class KeysView[int]:- def __init__(self, *args, **kwargs) -> None: ...- @overload- def __contains__(self, arg0: int) -> bool: ...- @overload- def __contains__(self, arg0: object) -> bool: ...- def __iter__(self) -> Iterator: ...- def __len__(self) -> int: ...--class KeysView[str]:- def __init__(self, *args, **kwargs) -> None: ...- @overload- def __contains__(self, arg0: str) -> bool: ...- @overload
def __contains__(self, arg0: object) -> bool: ...
def __iter__(self) -> Iterator: ...
def __len__(self) -> int: ...
class OpsById:
def __init__(self) -> None: ...
- def items(self) -> ItemsView[int,object]: ...- def keys(self) -> KeysView[int]: ...- def values(self) -> ValuesView[object]: ...+ def items(self) -> ItemsView: ...+ def keys(self) -> KeysView: ...+ def values(self) -> ValuesView: ...
def __bool__(self) -> bool: ...
@overload
def __contains__(self, arg0: int) -> bool: ...
@@ -101,9 +84,9 @@
class OpsByName:
def __init__(self) -> None: ...
- def items(self) -> ItemsView[str,object]: ...- def keys(self) -> KeysView[str]: ...- def values(self) -> ValuesView[object]: ...+ def items(self) -> ItemsView: ...+ def keys(self) -> KeysView: ...+ def values(self) -> ValuesView: ...
def __bool__(self) -> bool: ...
@overload
def __contains__(self, arg0: str) -> bool: ...
@@ -331,7 +314,7 @@
class TF_Status:
def __init__(self, *args, **kwargs) -> None: ...
-class ValuesView[object]:+class ValuesView:
def __init__(self, *args, **kwargs) -> None: ...
def __iter__(self) -> Iterator: ...
def __len__(self) -> int: ... |
rwgk
commented
Jan 9, 2024
@aimir@sizmailov I'm still interested in your review of this PR. I'll wait another couple days. |
rwgk
commented
Jan 13, 2024
class_ for KeysView/ValuesView/ItemsView. Fix #4529class_ for KeysView/ValuesView/ItemsView.
Description
Another alternative to PR #4972 and PR #4983. Fixes issue #4529.
See #4983 (comment)
Suggested changelog entry: