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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user