Examveda
Examveda

What is the purpose of the functools.wraps() function in decorators?

A. To create a new function

B. To modify the decorator's behavior

C. To preserve the original function's metadata

D. To remove a decorator

Answer: Option C

Solution(By Examveda Team)

functools.wraps() preserves the original function's metadata when using decorators.

This Question Belongs to Python Program >> Decorators In Depth

Join The Discussion

Related Questions on Decorators in Depth