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

Support for resolving typed lists with ContainerBuilder #10

Open
ticdenis opened this issue Jun 12, 2022 · 0 comments
Open

Support for resolving typed lists with ContainerBuilder #10

ticdenis opened this issue Jun 12, 2022 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@ticdenis
Copy link
Collaborator

ticdenis commented Jun 12, 2022

This is currently not possible and it would be great if examples like the following could work.

class UserPermission:
  pass

def default_user_permissions() -> list[UserPermission]:
  return [UserPermission()]

class UserHandler:
  __slots__  = '_permissions'
  
  def __init__(self, permissions: list[UserPermission]) -> None:
    self._permissions = permissions 
[tool.aiodi.services."default_user_permissions"]
class = "sample.default_user_permissions"

[tool.aiodi.services."UserHandler"]
class = "sample.UserHandler" # <- this will fails because library does not inspect list type.
@ticdenis ticdenis added enhancement New feature or request help wanted Extra attention is needed labels Jun 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant