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

Parsing Args And Kwargs In Decorators

I've got a function that takes args and kwargs, and I need to do something in my decorator base… Read more Parsing Args And Kwargs In Decorators

Decorated Class Looses Acces To Its Attributes

I implemented a decorator that worked like a charm until I added attributes to the decorated class.… Read more Decorated Class Looses Acces To Its Attributes

Java: Automatic Memoization

I have a few functions in my code where it makes much sense (seems even mandatory) to use memoizati… Read more Java: Automatic Memoization

Passing Default Arguments To A Decorator In Python

I am trying to find a way to pass my function's default arguments to the decorator. I have to s… Read more Passing Default Arguments To A Decorator In Python

How To Get Source Code Of Function That Is Wrapped By A Decorator?

I wanted to print the source code for my_func, that is wrapped by my_decorator: import inspect from… Read more How To Get Source Code Of Function That Is Wrapped By A Decorator?

Python: Regular Method And Static Method With Same Name

Introduction I have a Python class, which contains a number of methods. I want one of those methods… Read more Python: Regular Method And Static Method With Same Name

Python Lru Cache Decorator Per Instance

Using the LRU Cache decorator found here: http://code.activestate.com/recipes/578078-py26-and-py30-… Read more Python Lru Cache Decorator Per Instance

Python Resettable Instance Method Memoization Decorator

I'm attempting to build a decorator for an instance method of a class that will memoize the res… Read more Python Resettable Instance Method Memoization Decorator