mirror of
https://github.com/pybind/pybind11.git
synced 2026-03-14 20:27:47 +00:00
Added __contains__ to stl bindings for maps (#1767)
* Added __contains__ to stl bindings for maps
This commit is contained in:
committed by
Wenzel Jakob
parent
c251434011
commit
30c0352348
@@ -56,7 +56,9 @@ def test_map(doc):
|
||||
"""std::map <-> dict"""
|
||||
d = m.cast_map()
|
||||
assert d == {"key": "value"}
|
||||
assert "key" in d
|
||||
d["key2"] = "value2"
|
||||
assert "key2" in d
|
||||
assert m.load_map(d)
|
||||
|
||||
assert doc(m.cast_map) == "cast_map() -> Dict[str, str]"
|
||||
|
||||
Reference in New Issue
Block a user