Retry: Enable C# parameters of type object accept any argument, passed from Python#889
Merged
filmor merged 6 commits intopythonnet:masterfrom Mar 3, 2020
Merged
Conversation
Member
Author
|
@filmor is there an instruction to run Python unit tests? |
Member
|
You can run the unit tests by using pytest (either just |
9e07d3a to
f83d8fc
Compare
Codecov Report
@@ Coverage Diff @@
## master #889 +/- ##
=======================================
Coverage 86.75% 86.75%
=======================================
Files 1 1
Lines 302 302
=======================================
Hits 262 262
Misses 40 40
Continue to review full report at Codecov.
|
Member
Author
|
@filmor AppVeyor failed for 3.6 x86 due to connectivity issue on the VM: https://ci.appveyor.com/project/pythonnet/pythonnet/builds/28271316 . Results are not being picked up. |
filmor
reviewed
Feb 13, 2020
…instead of failing This enables overload resolution with object parameters to behave the same way PyObject parameters behave - e.g. allow any Python object to be passed as PyObject as fallback. Resolves pythonnet#811
2f7b0e9 to
102239a
Compare
102239a to
6373197
Compare
filmor
approved these changes
Mar 3, 2020
AlexCatarino
pushed a commit
to QuantConnect/pythonnet
that referenced
this pull request
Jun 29, 2020
…m Python (pythonnet#889) * added a regression test for pythonnet#881 * when converting to object, wrap values of unknown type into PyObject instead of failing This enables overload resolution with object parameters to behave the same way PyObject parameters behave - e.g. allow any Python object to be passed as PyObject as fallback. Resolves pythonnet#811 * fixed ObjectField conversion test * fixed test_object_indexer to pass on custom class key * use object() instance in OverloadResolution_UnknownToObject test
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this implement/fix? Explain your changes.
Previously when a C# method with a parameter of type
objectwas called from Python with some argument of a native Python type (e.g. instance ofdictrather than instance ofSystem.Random), that would be considered a parameter type mismatch, so overload resolution would fail, and the C# method would not be called.After this change, when Python tries to pass a argument of some Python type to a C# parameter of type
object, that overload would be considered good for resolution, and the argument will be wrapped intoPyObjectand passed to theobjectparameter.For example:
Before change: overload not found
After change:
anythinginCallMeis an instance ofPyObject, wrapping adictinstance, soCallMeoutputs{}Does this close any currently open issues?
#811
Checklist
Check all those that are applicable and complete.
AUTHORSCHANGELOGP.S.
This is a retry of #853