I am trying to override the default __import__ method provided by IronPython to handle database imports. I have already run through the example provided here: https://stackoverflow.com/a/4127766/862319
Everything is working so far, but there is a minor issue related to namespace resolution within CLR types. I am able to import using the syntax import ClrAssembly.Type
but the syntax from ClrAssembly import Type
does not work. This is a minor inconvenience, but I would like to get it resolved. My suspicion is that there are two method signatures tied to the __import__method in IronPython:
But, the SO link above results in only a single method being applied with the 5 parameter signature. Here is the __import__ variable after being set:
How would I go about constructing a custom IronPython.Runtime.Types.BuiltinFunction
that maps to 2 method signatures (5 param and 2 param version of DoDatabaseImport) and assign it back to the __import__ variable?