Added parameter validation to PyObject methods#1021
Conversation
fbd4621 to
3307496
Compare
Codecov Report
@@ Coverage Diff @@
## master #1021 +/- ##
=======================================
Coverage 86.71% 86.71%
=======================================
Files 1 1
Lines 301 301
=======================================
Hits 261 261
Misses 40 40
Continue to review full report at Codecov.
|
|
@filmor any chance to look at this? This is a pretty light change. |
src/runtime/pyobject.cs
Outdated
| /// <summary> | ||
| /// Gets the specified attribute. If attribute is not found, returns the fallback value. | ||
| /// </summary> | ||
| public PyObject GetAttrOrElse(string name, PyObject _default) |
There was a problem hiding this comment.
How much would it hurt to make this behaviour the default? We are using GetAttr a lot, I think (even in this file).
There was a problem hiding this comment.
@filmor I don't know, I don't have any legacy code :)
But that would be a breaking change in contract.
There was a problem hiding this comment.
I decided to take this change out, so the rest could be merged.
|
Almost completely fine, but I'm not quite sure about the |
* added parameter validation to PyObject methods
What does this implement/fix? Explain your changes.
This adds basic validations to input parameters of various
PyObjectmethods, which should help in debugging code, that uses Python.NET.Also adds a few function overloads
Does this close any currently open issues?
No, but it reduces divergence with Lost Tech fork
Checklist
Check all those that are applicable and complete.
AUTHORSCHANGELOG