Skip to content

Add contains in dict_keys#3271

Merged
youknowone merged 1 commit into
RustPython:mainfrom
Jack-R-lantern:dict_key/__contains__
Oct 11, 2021
Merged

Add contains in dict_keys#3271
youknowone merged 1 commit into
RustPython:mainfrom
Jack-R-lantern:dict_key/__contains__

Conversation

@Jack-R-lantern

Copy link
Copy Markdown
Contributor

Added

PyDictKey::{contains}

test_case

builtin_dict.py l41 ~ l50

d = {1: 10, "a": "ABC", (3,4): 5}
assert 1 in d.keys()
assert (1) in d.keys()
assert "a" in d.keys()
assert (3,4) in d.keys()
assert () not in d.keys()
assert 10 not in d.keys()
assert (1, 10) not in d.keys()
assert "abc" not in d.keys()
assert ((3,4),5) not in d.keys()

Issue

issue: #3268

@youknowone youknowone merged commit fd71647 into RustPython:main Oct 11, 2021
@Jack-R-lantern Jack-R-lantern deleted the dict_key/__contains__ branch October 11, 2021 17:52
@Jack-R-lantern

Copy link
Copy Markdown
Contributor Author

Adding a ref to #2898 for trackability

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants