boostorg / boostorg/python

Extends dict key error

オープン
#245 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
C++
スター
537
フォーク
223
平均マージ
11時間 22分
マージ済み PR(30日)
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 はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。