arotem wrote:
> Hi,
> 
> I am trying to call an unbound method (PrintInput) with the object
> instance as the first argument but getting the following error:
> "TypeError: unbound method PrintInput() must be called with test
> instance as first argument (got test instance instead)"
> 
> Below is the sample code (test) for this purpose (two files).
> 
> Any help is greatly appreciated.

The problem is your circular import. When test.py is invoked, it imports 
  input_file.py, which in turn imports test, creating a class bound to 
the name test.test. Then the rest of test is interpreted, creating a 
__main__.test. While both are based on the same code, they are two 
different instances of classes.

To fix this, put your test-class in a separate module, and import that 
from both input_file.py and test.py

Diez
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to