list of dots Digital Research Alliance of Canada logo  NSERC logo  University of Ottawa logo / UniversitĂ© d'Ottawa

User Manual    [Previous]   [Next]   

E9218 Python Path Clash

Two namespaces or classes would share a Python package or module

Each namespace becomes a Python package folder and each class a module file. Python matches the case of module names even where file names ignore case, as on Windows and macOS. There, namespaces such as Shop and shop would share one folder, and classes such as Item and item in one namespace would share one file, so one of them could not be imported. Python also imports a module rather than a namespace of the same name, so a class Shop and a namespace Shop in the same place cannot both be used. The Python generator reports the class or interface generated later and does not generate it.

Spell each namespace the same way everywhere, or give one of the classes or namespaces another name.

Example

// The two namespaces differ only in case, so where file names
// ignore case they would share one folder: E9218
generate Python;
namespace Shop;
class Item {
  name;
}

namespace shop;
class Order {
  Integer number;
}

      

Load the above code into UmpleOnline

 

Solution to The Above So the Message No Longer Appears

// One spelling of the namespace gives one package
generate Python;
namespace shop;
class Item {
  name;
}

namespace shop;
class Order {
  Integer number;
}

      

Load the above code into UmpleOnline