Examveda

What is the purpose of the functools.partial function in decorators?

A. To create a partial function

B. To replace built-in functions

C. To preserve the original function's metadata

D. To modify the decorator's behavior

Answer: Option A

Solution (By Examveda Team)

The functools.partial function is used to create a new function with some arguments pre-filled.

This Question Belongs to Python Program >> Decorators In Depth

Join The Discussion

Related Questions on Decorators in Depth