1 pointby disel6 hours ago1 comment
  • disel6 hours ago
    I have recently released a new python library for dependency injection and its been hard to publish it because a lot of places remove project/library showcase due to AI slop, I really think this library can bring some value

    ## some background a year ago I needed a DI library for python to be a key component in an internal project, I expected that a simple google search would solve my problem but it didn't, all the DI libraries I found either had weird behavior or were targeting web frameworks (like fastapi), I resolved to writing something internal for that project

    because of the lack of good DI libraries (in my opinion) I decided to published my own one that would make sense

    ## what is different/included while writing the library, the core mental design was "explicit is better then implicit"

    * an expected behavior, everything is a singleton unless stated differently * support typevar generics * support lazy dependencies for circular dep * shared instances between different scopes * contextvars support * temporary scopes for temporary instances * union support

    ## what is not supported * list values * async injectable (need to work on that)

    I have integrated this library into few other personal/work projects, I need to work on better error messages, but I have yet to face an issue (all project used python 3.11)

    since I am the one who wrote this library it feels very intuitive for me, wondering if it the same for other people.

    ## AI statement the project doesn't use AI