2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-24 06:02:14 +00:00

introduce object.contains(), a wrapper of Python 'in' operator. And reimplement dict.has_key by call object.contains(). Because dict.has_key is removed in py3k

[SVN r54836]
This commit is contained in:
Haoyu Bai
2009-07-09 17:45:26 +00:00
parent ff0e58d30d
commit 3a75666f22
2 changed files with 14 additions and 1 deletions

View File

@@ -84,7 +84,7 @@ object dict_base::get(object_cref k, object_cref d) const
bool dict_base::has_key(object_cref k) const
{
return extract<bool>(this->attr("has_key")(k));
return extract<bool>(this->contains(k));
}
list dict_base::items() const