meadsteve/lagom

circular dep crashes

Closed this issue · 1 comments

from lagom import Container
class B:
    def __init__(self, a: 'A') -> None:
        self.a = A
class A:
    p = 'x'

    def __init__(self, b: B) -> None:
        self.b = b
def test():
    c = Container()
    _ = c[A]
    return _

crashes my python. should raise an exception.

PR #267 adds a new exception when lagom detects this situation. It should be released soon.