Title: Strange behavior with ternary operator · Issue #493 · boostorg/python · GitHub
Open Graph Title: Strange behavior with ternary operator · Issue #493 · boostorg/python
X Title: Strange behavior with ternary operator · Issue #493 · boostorg/python
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 using py = boost::python; py::dict globals; py::dict dict; py::list list; bool condition = true; glob...
Open Graph 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 using py = boost::python; py::dict globals; py::dict dict; py...
X 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 using py = boost::python; py::dict globals; py::dict dict...
Opengraph URL: https://github.com/boostorg/python/issues/493
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Strange behavior with ternary operator","articleBody":"I noticed strange behavior while trying to use ternary operator with `boost::python::dict` and `list`.\nI'm trying to do something like this\n```cpp\nusing py = boost::python;\n\npy::dict globals;\npy::dict dict;\npy::list list;\nbool condition = true;\nglobals[\"mol\"] = condition ? dict : list;\npy::exec(\"print(type(mol))\", globals);\n```\n\nWhat I expected: `\u003cclass 'list'\u003e` or `\u003cclass 'dict'\u003e`\nWhat I got: `\u003cclass 'Boost.Python.function'\u003e`\n\nIs it expected behavior? Then can someone explain me why?\nOr this is a bug?","author":{"url":"https://github.com/sadseeker","@type":"Person","name":"sadseeker"},"datePublished":"2025-06-20T13:50:11.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/493/python/issues/493"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:40b1979e-336c-02b4-b761-d9d4eb8769fd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C71C:2713AA:18344C0:205FC4B:6970413E |
| html-safe-nonce | ef184a7801bb0bba205594fecdf04db5b935235a0361ecb5e0137b37a4c6d85a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNzFDOjI3MTNBQToxODM0NEMwOjIwNUZDNEI6Njk3MDQxM0UiLCJ2aXNpdG9yX2lkIjoiNTE2OTI2NTQ3MzQ5NjMwMTg4NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3b379b2616480d1f0fc33141491e32d0310e212a581af15d6fc870aaf3a6deb0 |
| hovercard-subject-tag | issue:3163422345 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/boostorg/python/493/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1aa927555fa8994db121fb164443eeb3393c02cc9208beccba9421f94ef58ed3/boostorg/python/issues/493 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1aa927555fa8994db121fb164443eeb3393c02cc9208beccba9421f94ef58ed3/boostorg/python/issues/493 |
| og:image:alt | I noticed strange behavior while trying to use ternary operator with boost::python::dict and list. I'm trying to do something like this using py = boost::python; py::dict globals; py::dict dict; py... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sadseeker |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9920a62ba22d06470388e2904804fb7e5ec51c9e35f81784e9191394c74b2bd2 |
| turbo-cache-control | no-preview |
| go-import | github.com/boostorg/python git https://github.com/boostorg/python.git |
| octolytics-dimension-user_id | 3170529 |
| octolytics-dimension-user_login | boostorg |
| octolytics-dimension-repository_id | 7589968 |
| octolytics-dimension-repository_nwo | boostorg/python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 7589968 |
| octolytics-dimension-repository_network_root_nwo | boostorg/python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f643964067a552f02067066d6a910b2f90a5721f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width