Is this assertion necessary? If translation fails without it, try assigning self.length() to a temporary variable at the beginning of the method, that may help the translator.