Home > database >  What is the python3 alternative to the apply method in python2 [duplicate]
What is the python3 alternative to the apply method in python2 [duplicate]

Time:09-27

I have a legacy piece of code that I'm upgrading to python3 but I've been stuck on the alternative of the apply python2 function that was dropped in python2.3 and replaced with function however function isn't working in python 3.8 Is there an alternative to this function?

I have return apply(fn, args, kwargs) I have tried return function(fn, args, kwargs)

but in both cases I'm getting a NameError

CodePudding user response:

Basically fn(*args, **kwargs) should solve your problem

  • Related