Thank you for getting adventurous

Below you will find a random blog post out of the creatronix space. Have fun while reading and learning something new!

How to implement Python Decorators

Motivation Python decorators are a nice way to implement the decorator pattern. Perhaps you read the article about Python data classes and wondered how the @dataclass thingy worked. Example Let’s say we created the following function: def un_decorated_function(): print(‘–> Starting un_decorated_function’) print(‘Inside un_decorated_function’) print(‘<– un_decorated_function finished’) This works but violates the DRY principle if repeated…

Read more

More posts

See the latest blogposts about code and business and everything inbetween.