Issue 642489: better error reporting for MRO conflict (original) (raw)
This patch improves the error reporting for MRO disagreement that results from constraints that C3 is unable to honor. It's not clear what the best error reporting would be. On the one hand, it seems like the exception should report exactly which constraint could not be satisfied and why, but the constraints are a bit suble to explain and perhaps hard from users to grok. It would also require a lot more code to keep track of the exact cause of the conflict.
Instead, this patch just reports the names of the classes that could not be added to the MRO. It doesn't report what constraint failed, but it does give you a good clue about where to look.
The patch also adds a bunch of comments to the C3 implementation. I hope that someone without the paper will have a little chance of maintaining the code.