boostorg / boostorg/python

Strange behavior with ternary operator

オープン
#493 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
C++
スター
537
フォーク
223
平均マージ
11時間 22分
マージ済み PR(30日)
2

説明

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?

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

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

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