Skip to content

Commit

Permalink
Mention type[ABC] doesn't work either
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Jul 28, 2023
1 parent 42c8977 commit 96e3c61
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ def index():
## Caveats

One would expect the the `Container.get()` method would have a type signature like `get(type: type[T]) -> T`.
Unfortunately, that's currently impossible because it [precludes the usage of `Protocols` as service types](https://github.com/python/mypy/issues/4717), making this package pointless.
Unfortunately, that's currently impossible because it [precludes the usage of `Protocols` and *abstract base classes* as service types](https://github.com/python/mypy/issues/4717), making this package pointless.

Therefore it returns `Any`, and until Mypy changes its stance, you have to use it like this:

Expand Down

0 comments on commit 96e3c61

Please sign in to comment.