Skip to content Skip to sidebar Skip to footer
Showing posts with the label Decorator

How Much Overhead Do Decorators Add To Python Function Calls

I've been playing around with a timing decorator for my pylons app to provide on the fly timing… Read more How Much Overhead Do Decorators Add To Python Function Calls

Use A Class Decorator To Implement Late-initialization

I am using some classes which need to connect to databases. The connection is only really needed wh… Read more Use A Class Decorator To Implement Late-initialization

How Do I Write A Decorator For My Django/python View?

Here's my view. Basically, it returns different Responses based on whether it's logged in o… Read more How Do I Write A Decorator For My Django/python View?

Python: Change Class Type With Decorator And Keep It's Methods

I want to create a class which could be used inside different Applications and their APIs to create… Read more Python: Change Class Type With Decorator And Keep It's Methods

Decorator Overwriting Post, Get And Request In Django - Doing It Right?

In Django, I have created a function decorator which can - in this example - create a lowercase ver… Read more Decorator Overwriting Post, Get And Request In Django - Doing It Right?

Python: __qualname__ Of Function With Decorator

I'm using a Decorator (class) in an Instance method of another class, like this: class decorato… Read more Python: __qualname__ Of Function With Decorator