Replies: 5 comments
-
If your modules depend on being imported in a certain order, then they should enforce that order by importing what they need. |
Beta Was this translation helpful? Give feedback.
-
I'm loading user scripts. If the user doesn't know about these dependencies (or ignored them …) I'd like to give them at least a somewhat-reasonable error message. Crashing doesn't help here; a program started via GUI or a browser doesn't show stderr. |
Beta Was this translation helpful? Give feedback.
-
The user should not need to know about these dependencies. You, the author of the extension modules, know about them. So, if Requiring the user to manage import order is not a viable solution, because there exist many tools that assume imports can be ordered arbitrarily for stylistic reasons. nanobind therefore treats this sort of issue as a programming error (abort) rather than an error in user code (throw an exception). |
Beta Was this translation helpful? Give feedback.
-
I do see your point; however, that boundary isn't always as clear-cut as we might like it to be. |
Beta Was this translation helpful? Give feedback.
-
There are good technical reasons to |
Beta Was this translation helpful? Give feedback.
-
gdb complained:
Ugh. That's a usage error in the Python script (importing those modules in the wrong order).
Could nanobind please throw an exception instead of aborting?
Beta Was this translation helpful? Give feedback.
All reactions