Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return type for the __init__ method (None) #5

Open
nme01 opened this issue Jul 31, 2017 · 3 comments
Open

Return type for the __init__ method (None) #5

nme01 opened this issue Jul 31, 2017 · 3 comments

Comments

@nme01
Copy link

nme01 commented Jul 31, 2017

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.

@nme01 nme01 changed the title dd Return type for the init method Jul 31, 2017
@nme01 nme01 changed the title Return type for the init method Return type for the __init__ method (None) Jul 31, 2017
@zsims
Copy link
Owner

zsims commented Jul 31, 2017

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.

@nme01
Copy link
Author

nme01 commented Aug 1, 2017

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)

@zsims
Copy link
Owner

zsims commented Aug 1, 2017

Thanks for the code. I'll look at fixing this, plus setting up Python 3.5 tests -- there's a fair bit that changed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants