Extends dict key error
- Linguagem predominante
- C++
- Estrelas
- 537
- Forks
- 223
- Merge médio
- 11h 22min
- PRs com merge (30d)
- 2
Descrição
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
```
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Direção de pesquisa
Reproduce the behavior from the C++ BOOST_PYTHON_MODULE(testdict) entry point and the Python expressions data['key'] = 1 and 'key' in data. Read the boost::python::dict inheritance and wrapping behavior to determine why assignment and membership disagree. Done means the intended dict semantics are established and the reported mismatch is fixed or clearly documented.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- cpp, python
- Domínio
- backend
- Tipo de issue
- Bug
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Status de atividade
- Estagnada
- Clareza
- Precisa de esclarecimento
- Facilidade para iniciantes
- 35/100