from typing import List
import punq
container = punq.Container()
container.register(List[str], instance=['hi'])
print(container.resolve(List[str]))
print(container.resolve(List[str]))
print(container.resolve_all(List[str]))
print(container.resolve(List[str]))
would result in
[]
[]
[['hi']]
['hi']
Resolve should resolve the List[str] in the first two resolve calls. Further be idempotent, as long as nothing nothing new is registered and the resolve_all call should not effect the result of subsequent calls to resolve.
Before this PR the following code
would result in
Resolve should resolve the
List[str]
in the first two resolve calls. Further be idempotent, as long as nothing nothing new is registered and theresolve_all
call should not effect the result of subsequent calls toresolve
.After this PR the result is: