// Calling processOrder with ["ord_123"]
// Processing ord_123
Note TS 5.0 introduced TC39 standard decorators - these are different from the legacy experimental decorators. Standard decorators receive a context object instead of the old three-parameter signature. Set "experimentalDecorators": false (or omit it) to use the new standard. Legacy decorators are still available with "experimentalDecorators": true.
Frequently asked questions
How does Python handle decorator?
This task is covered in 2 stacks on this page: Python, TypeScript. The "Decorators" snippet in Python uses `@decorator`.
Which code does the Python example use?
The "Decorators" snippet uses `@decorator`, from the Functions section of the Python cheat sheet.
Which stacks cover "decorator" on this page?
Python, TypeScript. Together they hold 2 copy-ready snippets for this task.
Is there anything to watch out for?
Yes. For "Decorators": Always use @functools.wraps(func) in your wrapper so that the decorated function preserves its name and docstring. Decorators run at import time.