Open pauleveritt opened 5 years ago
@mmerickel Can you assign this to me (or change my permissions to let me assign tickets)?
I feel like wired can be fairly strongly typed right now. For example, I think it's basically:
from typing import Type, TypeVar
ServiceType = TypeVar('Service')
ContextType = TypeVar('Context')
class ServiceContainer:
def get(service_type: Type[ServiceType], context: ContextType, name: str) -> ServiceType:
pass
I imagine there's open questions about whether you can go further than a generic TypeVar
by requiring it to be a class-or-interface, etc. Hmm.
@mmerickel FWIW this comment describes some interesting typing related, I believe, to your comment in the DI code about something you'd like for type hinting.
Look at ways to get some more type hinting into the core. Gonna be some type theory.