Skip to content

Instantly share code, notes, and snippets.

@lostmsu
Created October 22, 2019 20:02
Show Gist options
  • Save lostmsu/124b11c49c98c4b558c4fdcfcd761c73 to your computer and use it in GitHub Desktop.
Save lostmsu/124b11c49c98c4b558c4fdcfcd761c73 to your computer and use it in GitHub Desktop.
How to register converter for a generic type?
using Python.Runtime;
class MyNonGenericTree
{
}
PyTypeConversion<MyNonGenericTree>.Converter = tree => ...;
class MyTree<T>
{
...
}
PyTypeConversion<MyTree<???>>.Converter = tree => ...;
// ^ what should I put in place of '???' so that my generic trees would be converted automatically ?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment