Skip to content

Commit

Permalink
docs: Add note on dependency injection when default given (#99)
Browse files Browse the repository at this point in the history
add note on defaults
  • Loading branch information
lucyleeow authored Dec 18, 2023
1 parent 2044fb3 commit f8acaa9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,15 @@ give_me_a_string()
# give_me_a_string() missing 1 required positional argument: 's'
```

!!!note
No dependency injection will be attempted for any parameters where a default value
is given, e.g.,:

```python
def get_things_name(thing: Thing = MyThing) -> str:
return thing.name
```

### Weights and provider priority

When registering multiple providers for the same type, you can use the
Expand Down

0 comments on commit f8acaa9

Please sign in to comment.