Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] Look into replacing the Object::Undefined() pattern with std::optional #163

Open
apaletta3 opened this issue Jan 29, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@apaletta3
Copy link
Contributor

Currently we use the ::Undefined() pattern to specify that an object is the None equivalent in python, but this is kind of cumbersome. You need to define an ::Undefined method for each object (half of our ostk-astro objects actually don't have it implemented) in order to get that behavior, and then when creating a composite object you have to always check memvar_->isDefined(); before you return it

It could be interesting to use std::optional and potentially even std::variant in a bunch of places to get more pythonic function signatures in cpp

@apaletta3 apaletta3 added the enhancement New feature or request label Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant