From be95ddaf8802fc215b0b4a62e7606e6fb02e2202 Mon Sep 17 00:00:00 2001 From: Wesley Ellis Date: Sun, 2 Feb 2020 07:15:42 -0500 Subject: [PATCH] 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 --- docs/usage/model_config.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/usage/model_config.md b/docs/usage/model_config.md index dacd4dd..797896b 100644 --- a/docs/usage/model_config.md +++ b/docs/usage/model_config.md @@ -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`)