-1

I keep getting this error from this line of code:

  result = simplify_path(obj.path_(mlength -2), obj.path_(mlength-1), obj.path(mlength));

result is just a temp variable and the everything has already been defined and works at other places in the code.

simplify_path is a function I defined elsewhere in another file. It is NOT method of my class. I made sure that everything is spelled correctly.

What is going on?

4
  • 1
    I'm guessing that obj.path_ should actually be obj.path, without the underscore. Without knowing anything else about obj or its methods, there's not much more we can suggest you try.
    – gnovice
    Jan 20, 2014 at 1:16
  • nope. it's supposed to be there. someone else wrote that. not sure why, though.
    – lars
    Jan 20, 2014 at 17:45
  • Is that the entire error message? Please show the whole thing. Also, is it possible that this is due to the space in front of the minus sign here: obj.path_(mlength -2)?
    – horchler
    Jan 20, 2014 at 23:18
  • See this question/answer in case the space issue fixes this.
    – horchler
    Jan 20, 2014 at 23:26

1 Answer 1

0

try:

result = simplify_path(obj.path_(mlength -2), ...
                       obj.path_(mlength-1),...
                       obj.path_(mlength));
2
  • mmm. this works. so I've checked the answer. But why does this work, and why didn't my way work.
    – lars
    Jan 20, 2014 at 17:46
  • @lars look at the final argument of the function: your code reads obj.path while my answer reads obj.path_. it's all in the details...
    – Shai
    Jan 20, 2014 at 19:22

Not the answer you're looking for? Browse other questions tagged or ask your own question.