Expose serialization api by BadSingleton · Pull Request #2336 · pythonnet/pythonnet

Adds post-serialization and pre-deserialization hooks for additional customization.

What does this implement/fix? Explain your changes.

This PR supersedes #1892 , offer another workaround for issues #2335 #2221 #2282 , possibly others.

Does this close any currently open issues?

This addresses @lostmsu 's comments of exposing an API instead of adding functionality

Any other comments?

According to Unity dev answers on the Unity forums, they will implement a ring-link architecture as a replacement for domain load/unload. I have added no tests yet in this PR considering that domain load/unload is deprecated from a .NEt perspective.
https://forum.unity.com/threads/unity-future-net-development-status.1092205/page-34#post-8918231

This PR is made in my own name, I am no longer working at the company that signed the CLA for me.

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
  • Ensure you have signed the .NET Foundation CLA
  • Add yourself to AUTHORS
  • Updated the CHANGELOG