Skip to content

Commit d73d82e

Browse files
authored
Merge pull request #37 from joshorr/josho/better-mypy-support-and-auto-off-by-default
docs: add info about how `Missing` is always `False`-like, etc.
2 parents 5f340c6 + 8d8d0d0 commit d73d82e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
+ [Explicitly Defined Partials - Basic Example](#explicitly-defined-partials---basic-example)
99
+ [Automatically Defined Partials - Basic Example](#automatically-defined-partials---basic-example)
1010
* [More Details](#more-details)
11+
+ [Missing](#missing)
1112
+ [Inheritable](#inheritable)
1213
+ [Exclude Fields from Automatic Partials (AutoPartialModel)](#exclude-fields-from-automatic-partials-autopartialmodel)
1314
+ [Auto Partials Configuration](#auto-partials-configuration)
@@ -159,6 +160,13 @@ This includes any inherited Pydantic fields (from a superclass).
159160

160161
## More Details
161162

163+
### Missing
164+
165+
The `Missing` value is a sentinel, and there is never more than one instance of it. So you can use the `is` operator with it,
166+
just like you would with `None`. It's of type `MissingType`.
167+
168+
When evaluated as a bool, `Missing` is always `False`; just like how `None` evaluates to `False`.
169+
162170
### Inheritable
163171

164172
With `AutoPartialModel`, you can inherit from a model to make an automatic partial-version of the inherited fields:

0 commit comments

Comments
 (0)