-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
fix: removing typing and duplicate class_
for KeysView/ValuesView/ItemsView.
#4985
Conversation
Thanks a lot @hczhai! I'll try global testing with this PR, too. |
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: ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
@aimir what's your opinion?
@aimir @sizmailov I'm still interested in your review of this PR. I'll wait another couple days. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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: