-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?

lars
  • 1,976
  • 5
  • 33
  • 47
  • 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 '14 at 01:16
  • nope. it's supposed to be there. someone else wrote that. not sure why, though. – lars Jan 20 '14 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 '14 at 23:18
  • See [this question/answer](http://stackoverflow.com/questions/18206816/error-using-simple-matrix-multiplication) in case the space issue fixes this. – horchler Jan 20 '14 at 23:26

1 Answers1

0

try:

result = simplify_path(obj.path_(mlength -2), ...
                       obj.path_(mlength-1),...
                       obj.path_(mlength));
Shai
  • 111,146
  • 38
  • 238
  • 371
  • mmm. this works. so I've checked the answer. But why does this work, and why didn't my way work. – lars Jan 20 '14 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 '14 at 19:22