Skip to content

object.GetRawPythonProxy() extension, that bypasses all conversions #1078

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

Merged
merged 1 commit into from
Mar 6, 2020

Conversation

lostmsu
Copy link
Member

@lostmsu lostmsu commented Mar 4, 2020

What does this implement/fix? Explain your changes.

GetRawPythonProxy creates a PyObject pointing to the specified CLR object without performing any conversions, which lets .NET code to pass CLR objects as-is, if it needs Python to have direct access to them.

This is necessary to allow codecs to create arbitrary proxy objects for .NET objects, bypassing default conversions or other registered codecs.

Does this close any currently open issues?

This is related to #514

Any other comments?

Without GetRawPythonProxy it is impossible for a user to define custom codec for List<T>, that returns raw proxy to List<T>, as they have no other means to obtain one.

Checklist

Check all those that are applicable and complete.

  • Make sure to include one or more tests for your change
  • If an enhancement PR, please create docs and at best an example
  • Add yourself to AUTHORS
  • Updated the CHANGELOG

@lostmsu lostmsu added this to the 2.4.1 milestone Mar 4, 2020
@codecov-io
Copy link

codecov-io commented Mar 4, 2020

Codecov Report

Merging #1078 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1078   +/-   ##
=======================================
  Coverage   86.75%   86.75%           
=======================================
  Files           1        1           
  Lines         302      302           
=======================================
  Hits          262      262           
  Misses         40       40
Flag Coverage Δ
#setup_linux 65.56% <ø> (ø) ⬆️
#setup_windows 71.52% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9fd877e...e7b5385. Read the comment docs.

GetRawPythonProxy creates a PyObject pointing to the specified object without performing any coversions, which lets .NET code to pass CLR objects as-is, if it needs Python to have direct access to them.

This enables codecs to create arbitrary proxy objects, bypassing default conversions or other registered codecs.
@lostmsu lostmsu force-pushed the features/PythonProxy branch from b0d748e to e7b5385 Compare March 4, 2020 19:36
@filmor filmor merged commit 653a932 into pythonnet:master Mar 6, 2020
@lostmsu lostmsu deleted the features/PythonProxy branch March 7, 2020 21:19
@lostmsu lostmsu modified the milestones: 2.4.1, 2.5.0 Apr 23, 2020
lostmsu added a commit to losttech/pythonnet that referenced this pull request May 1, 2020
filmor pushed a commit that referenced this pull request May 1, 2020
…sting PyObject.FromManagedObject (#1132)

Reverts most of #1078
AlexCatarino pushed a commit to QuantConnect/pythonnet that referenced this pull request Jun 29, 2020
GetRawPythonProxy creates a PyObject pointing to the specified object without performing any coversions, which lets .NET code to pass CLR objects as-is, if it needs Python to have direct access to them.

This enables codecs to create arbitrary proxy objects, bypassing default conversions or other registered codecs.
AlexCatarino pushed a commit to QuantConnect/pythonnet that referenced this pull request Jun 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants