Top "Decorator" questions

Decorator is an object-oriented design pattern that allows adding behavior to existing classes in a dynamic fashion.

Can I combine two decorators into a single one in Python?

Is there a way to combine two decorators into one new decorator in python? I realize I can just apply …

python decorator
React-MobX Error: The 'decorators' plugin requires a 'decoratorsBeforeExport' option, whose value must be a boolean

I get the following error: If you are migrating from Babylon/Babel 6 or want to use the old decorators proposal, …

reactjs decorator mobx-react
Is it possible to decorate include(...) in django urls with login_required?

I have a few restricted areas on the site, for which I would like to specify login_required decorator. However …

django url functional-programming decorator
Why can @decorator not decorate a staticmethod or a classmethod?

Why can decorator not decorate a staticmethod or a classmethod? from decorator import decorator @decorator def print_function_name(function, *…

python decorator
How to get MobX Decorators to work with Create-React-App v2?

Support for the experimental syntax 'decorators-legacy' isn't currently enabled I tried adding the decorators-legacy babel plugin and @babel/plugin-proposal-decorators with { …

reactjs decorator babeljs create-react-app mobx
How to skip a pytest using an external fixture?

Background I am running a py.test with a fixture in a conftest file. You can see the code below(…

python decorator pytest python-decorators
How do I use the Decorator Pattern with Unity without explicitly specifying every parameter in the InjectionConstructor

This helpful article from David Haydn (EDIT: scam link removed, it could have been this article) shows how you can …

c# unity-container decorator
Python-like C++ decorators

Are there ways to decorate functions or methods in C++ like in python style? @decorator def decorated(self, *args, **kwargs): …

python c++ function macros decorator
Typescript annotations

I am writing project on MarionetteJS using TS and I want to use annotations to register routes. For example: @Controller …

typescript annotations marionette decorator
PHP equivalent for a python decorator?

I want to be able to wrap a PHP function by another function, but leaving its original name/parameter list …

php python function decorator wrapper