A super lightweight python injection library. It does one thing, it creates injectables.
Project description
Injectables
=======================
This is a super lightweight library for creating dependency injectables
::
@injectable
def how_are_you():
return "how_are_you?"
@injectable
def im_fine(how_are_you):
print(how_are_you)
return 'I am fine'
@injectable
def conversation(im_fine):
print (im_fine)
print ('good to hear')
# run function as injectable, which resolves and injects all dependencies first
conversation()
# how are you?
# I am fine
# good to hear
# override injection flow and call normally
conversation(override=True, im_fine="hey!!!!")
# hey!!!!
# good to hear
=======================
This is a super lightweight library for creating dependency injectables
::
@injectable
def how_are_you():
return "how_are_you?"
@injectable
def im_fine(how_are_you):
print(how_are_you)
return 'I am fine'
@injectable
def conversation(im_fine):
print (im_fine)
print ('good to hear')
# run function as injectable, which resolves and injects all dependencies first
conversation()
# how are you?
# I am fine
# good to hear
# override injection flow and call normally
conversation(override=True, im_fine="hey!!!!")
# hey!!!!
# good to hear
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
injectables-0.0.6.tar.gz
(2.1 kB
view details)
File details
Details for the file injectables-0.0.6.tar.gz.
File metadata
- Download URL: injectables-0.0.6.tar.gz
- Upload date:
- Size: 2.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc55fb2a2d998b0ee16f7c2c2352d18adf6c0dac218f0d2467e5558d0a9f7cf2
|
|
| MD5 |
d68369127cce7a62abc7d0ab269cfef3
|
|
| BLAKE2b-256 |
36f48c1badea6f3a85228904fc99de760dc8d745a6de0868f2391fe97868ca45
|