Be more specific about the meaning of Config.extra (#1203)

* Be more specific about the meaning of Config.extra

When reading through the docs as a beginner, it was not clear to me what the difference between `'allow'` and `'ignore'` was. I fixed this by adding a short description of each of the options from what I can tell from reading the source code.

Is there a better way to format this? Maybe as a list?


(ps, thanks for the cool library)

* tiny further clarification

* sorry...

Co-authored-by: Samuel Colvin <samcolvin@gmail.com>
This commit is contained in:
Wesley Ellis
2020-02-02 07:15:42 -05:00
committed by GitHub
parent 55f7d35727
commit be95ddaf88
+3 -1
View File
@@ -19,7 +19,9 @@ Options:
**`extra`**
: whether to ignore, allow, or forbid extra attributes during model initialization. Accepts the string values of
`'ignore'`, `'allow'`, or `'forbid'`, or values of the `Extra` enum (default: `Extra.ignore`)
`'ignore'`, `'allow'`, or `'forbid'`, or values of the `Extra` enum (default: `Extra.ignore`).
`'forbid'` will cause validation to fail if extra attributes are included, `'ignore'` will silently ignore any extra attributes,
and `'allow'` will assign the attributes to the model.
**`allow_mutation`**
: whether or not models are faux-immutable, i.e. whether `__setattr__` is allowed (default: `True`)