dic
dic copied to clipboard
Return type for the __init__ method (None)
When one tries to write a type annotation for the __init__
method, the container will try to resolve this type (which is None
) and this will cause an error.
Thanks for raising this, much appreciated. Do you have a small code sample that replicates this? Would also help to know what version of Python you're running.
I'm using Python 3.5.1. Here's the code.
from dic.container import ContainerBuilder
class Dummy(object):
def __init__(self) -> None:
pass
builder = ContainerBuilder()
builder.register_class(Dummy)
container = builder.build()
container.resolve(Dummy)
Thanks for the code. I'll look at fixing this, plus setting up Python 3.5 tests -- there's a fair bit that changed