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
Miscellaneous fixes and cleanups #1760
base: master
Are you sure you want to change the base?
Conversation
| } | ||
| return Exceptions.RaiseTypeError("invalid object"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think keeping input parameter validation returns before the main body is a good practice.
| } | ||
|
|
||
| return new EventBinding(self.name, self.reg, new PyObject(ob)).Alloc(); | ||
| return Exceptions.RaiseTypeError("invalid argument"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same, validate and quick exit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with this in general, but here this would mean that instead of a single RaiseTypeError with a particular string, we need two, which does not look like an advantage to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the old version is easier to read. Nesting makes it harder.
| } | ||
| return Exceptions.RaiseTypeError("invalid target"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same


What does this implement/fix? Explain your changes.
...
Does this close any currently open issues?
...
Any other comments?
...
Checklist
Check all those that are applicable and complete.
AUTHORSCHANGELOG