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

Fix potential circular dependencies #43

Closed
virtuald opened this issue Jan 16, 2020 · 2 comments · Fixed by #84
Closed

Fix potential circular dependencies #43

virtuald opened this issue Jan 16, 2020 · 2 comments · Fixed by #84
Assignees
Labels
enhancement New feature or request
Projects

Comments

@virtuald
Copy link
Member

I believe the way to fix this is make each class wrapper a class, where the declarations are initialized in the constructor (called in toposort order), and then methods are called

class XWrapper {
  py::class<X> cls_X;

  XWrapper(py::module &m) : cls_X(m, "X") {}

  init_methods() {
     cls_X.def( ) ... 
  }
}

For now, I'm going to provide a manual way to override the ordering.

@virtuald
Copy link
Member Author

@auscompgeek I wonder if this would fix the documentation issues we were having with names not being registered properly?

@virtuald virtuald added this to To do in 2021 Season via automation Mar 24, 2020
@virtuald virtuald added the enhancement New feature or request label Mar 24, 2020
@auscompgeek
Copy link
Member

Sounds like that'd work, yeah. I struggled to figure out a way to create the classes before all the methods before; didn't think of newtypes.

@virtuald virtuald self-assigned this Aug 28, 2020
virtuald added a commit that referenced this issue Sep 3, 2020
- Use a two-phase registration so that all objects are registered before trying to use them
- Fixes #43
virtuald added a commit that referenced this issue Sep 3, 2020
- Use a two-phase registration so that all objects are registered before trying to use them
- Fixes #43
2021 Season automation moved this from To do to Done Sep 7, 2020
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
No open projects
2021 Season
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants