python-dependency-injector icon indicating copy to clipboard operation
python-dependency-injector copied to clipboard

add method to container

Open antonio-antuan opened this issue 1 year ago • 1 comments
trafficstars

Is there any way to add a method to container?

from dependency_injector import containers


class Container(containers.DeclarativeContainer):

    def check(self):
        print('check')


c = Container()
c.check()

this code raises AttributeError: 'DynamicContainer' object has no attribute 'check'

antonio-antuan avatar Oct 03 '24 08:10 antonio-antuan

did you find any solution?

mhassan5809 avatar Apr 21 '25 10:04 mhassan5809