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

Class Decorator Compatible For Mypy

Say I have the following simple example without any typehints: def wrapper(cls): class Subclass… Read more Class Decorator Compatible For Mypy

Decorating A Class To Monitor Attribute Changes

I want to have classes that automatically send notifications to subscribers whenever one of their a… Read more Decorating A Class To Monitor Attribute Changes

Typeerror: 'nonetype' Object Is Not Iterable When Applying Decorator To Generator

I have a decorator function which I want to apply to both normal function and a generator. When app… Read more Typeerror: 'nonetype' Object Is Not Iterable When Applying Decorator To Generator

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

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

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