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

User Manual    [Previous]   [Next]   

E9217 Python Package Name

A namespace is not a valid Python package name

A class in a namespace is generated as a module of the package named by the namespace, so each part of the namespace must be made of ASCII letters, digits and underscores, must not start with a digit, and must not be a Python keyword. Namespaces such as releases.2024 or those taken from URLs cannot be imported, so their classes are reported and not generated. Use a namespace made of such names. A namespace whose first part is a standard Python module is reported with E9213.

Example

// Python packages are identifiers, so a namespace segment
// such as 2024 cannot be imported: E9217
generate Python;
namespace releases.2024;
class Release {
  name;
}
// @@@skipcompile - Java packages cannot start with a digit either

      

Load the above code into UmpleOnline

 

Solution to The Above So the Message No Longer Appears

// A namespace made of identifiers is a valid Python package
generate Python;
namespace releases.y2024;
class Release {
  name;
}

      

Load the above code into UmpleOnline