boostorg / boostorg/python

Strange behavior with ternary operator

Đang mở
#493 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
C++
Star
537
Fork
223
Merge trung bình
11 giờ 22 phút
Pull request đã merge (30 ngày)
2

Mô tả

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?

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.