Home > OS >  calling a function from a function object in python
calling a function from a function object in python

Time:07-10

how to call a function from a function object

a = fun_name
print(a)

like from this function object that I get how can I call the original function only from using this function object

<function fun_name at 0x00000265C9B0E320>

CodePudding user response:

You just call the object, since it's just a function object, not really but it refers to it, example:

def a():

    return 'a'

b = a
print(b())

CodePudding user response:

You can call the original function like a() in this case.

  • Related