-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
python: raise exceptions for Math API usage errors.
Originally those were assertions that were kept even in release builds, which meant that calling math.angle() on non-normalized vectors aborted the whole Python interpreted. Not great. But then the assertions were made debug-only, which means invalid usage from Python (where the bindings are usually only built as Release) now silently gives back a wrong result, which is perhaps even worse. Because the Python overhead is already massive due to all string lookup and such, doing one more check in the implementations isn't really going to slow down anything. Thus I'm mirroring all (debug-only) Magnum assertions on the Python side, turning them into exceptions. With proper messages as well, because those are extremely useful.
- Loading branch information
Showing
5 changed files
with
480 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.