45 questions for “Decorators”

Found in 1 field. Select a question to see its full answer.

Information Technology

45 questions in 2 technologies

#QuestionTechnologyTopicLevel
1In what order do multiple decorators applied to the same declaration execute? TypeScript › DecoratorsTypeScriptDecoratorsAdvanced
2How do parameter decorators work, and what is a common real-world use for them? TypeScript › DecoratorsTypeScriptDecoratorsAdvanced
3How do the newer, TC39 'Stage 3' decorators differ from TypeScript's legacy experimentalDecorators implementation? TypeScript › DecoratorsTypeScriptDecoratorsAdvanced
4Why can decorators make code harder to statically analyze or tree-shake, and what's a common criticism of overusing them? TypeScript › DecoratorsTypeScriptDecoratorsAdvanced
5How do you stack MULTIPLE decorators on the same function, and in what order do they actually execute? Python › DecoratorsPythonDecoratorsAdvanced
6How does @functools.wraps preserve metadata when writing decorators? Python › functools & Functional Programming ToolsPythonfunctools & Functional Programming ToolsIntermediate
7How would you implement a function that dynamically inspects its own call arguments at runtime using the 'inspect' module, useful for building generic validation or logging decorators? Python › Functions & ScopePythonFunctions & ScopeAdvanced
8What is a decorator in TypeScript, and what does the @ syntax mean? TypeScript › DecoratorsTypeScriptDecoratorsBeginner
9What must be enabled in tsconfig.json to use the (legacy, 'experimental') decorator syntax? TypeScript › DecoratorsTypeScriptDecoratorsBeginner
10What is a decorator, and how does the @decorator_name syntax relate to a plain function call? Python › DecoratorsPythonDecoratorsBeginner