boostorg / boostorg/python

Strange behavior with ternary operator

Ouverte
#493 3 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
C++
Étoiles
537
Forks
223
Merge moyen
11 h 22 min
PR mergées (30 j)
2

Description

I noticed strange behavior while trying to use ternary operator with `boost::python::dict` and `list`.
I'm trying to do something like this
```cpp
using py = boost::python;

py::dict globals;
py::dict dict;
py::list list;
bool condition = true;
globals["mol"] = condition ? dict : list;
py::exec("print(type(mol))", globals);
```

What I expected: `` or ``
What I got: ``

Is it expected behavior? Then can someone explain me why?
Or this is a bug?

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.