Extends dict key error
未关闭
- 主要语言
- C++
- 星标
- 537
- 派生
- 223
- 平均合并
- 11 小时 22 分钟
- 30 天内合并 PR
- 2
描述
I have written two snippets, with cpp and python
```c++
#include
#include
#include
using namespace boost::python;
struct testdict : public boost::python::dict {
testdict()
{
std::cout << "constructor" << std::endl;
}
virtual ~testdict()
{
std::cout << "destructor" << std::endl;
}
};
BOOST_PYTHON_MODULE(boost) {
class_>("testdict");
};
```
```python
#!/usr/bin/python3
# coding=utf-8
import boost
data = boost.testdict()
data['key'] = 1
print(data)
print('key' in data)
```
compile cpp code and run python code the output is not expected
```
constructor
{'key': 1}
False
```
贡献指南
这个仓库没有索引到贡献指南
评估
这个 Issue 还没有评估数据。