Question

why does IronPython allow, to import two enums with the same name from different namespaces, for example:

from System.Windows *
from ESS.MS.Framework.UIG.Mask import *

Both import the enum WindowState with different members.

It seems, that some time IronPython pick the right enum and some times not. Very confusing... (IronPython 2.7.4)

Thank you!

Was it helpful?

Solution

You should define an alias:

from System.Windows import WindowState as WindowState1
from ESS.MS.Framework.UIG.Mask import WindowState as WindowState2

or for the entire module

import System.Windows as Module1
import ESS.MS.Framework.UIG.Mask as Module2

//...
Module1.WindowState
Module2.WindowState

PS. choose of course better aliases

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top