Skip to content
CodeKruPro

A decorator without functools.wraps

QuizMediumPython onlyAsked in: Netskope

A decorator is a function that takes a function and returns a new one that wraps it. @deco above a def applies it. What does the last line print?

def deco(fn):
    def wrapper(*args, **kwargs):
        return fn(*args, **kwargs)
    return wrapper

@deco
def login_test():
    pass

print(login_test.__name__)
  • wrapper
  • login_test
  • deco

This question is part of Pro+

Pro+ opens every question in Interview Prep and the mock interview. Every article and the first 2 questions of each topic stay free. Hands-on Selenium and API tasks follow their course lesson's own lock.

See Pro+

Already have Pro+? Sign in