class Reports()
_name = 'reports'
def fetch_transaction_invoice():
#any logic here
class Bar():
_name = 'bar'
def test_method():
# here i want to access fetch_transaction_invoice of Reports class.
但当我尝试跟随
class Bar():
_name = 'bar'
def test_method():
Reports.fetch_transaction_invoice ()
它给了我以下的错误。
TypeError: unbound method fetch_transaction_invoice() must be called with Reports instance as first argument (got nothing instead)