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

User Manual    [Previous]   [Next]   

E9216 Python Duplicate Parameter

Two parameters get the same Python name

The Python generator renames a parameter named like a Python keyword: in becomes input, and other keywords get a trailing underscore (lambda becomes lambda_). When two parameters of a method then have the same name, it reports this error at the method (for an event, at its class) and does not write a Python file for the class. Rename one of the parameters.

Example

// A parameter named in becomes input in Python (in is a
// Python keyword), which the second parameter already uses
generate Python;
class Copier {
  String copy(String in, String input) Python { return input }
}

      

Load the above code into UmpleOnline

 

Solution to The Above So the Message No Longer Appears

// Distinct Python names for the parameters
generate Python;
class Copier {
  String copy(String source, String input) Python { return input }
}

      

Load the above code into UmpleOnline