typedparser 0.11.2__tar.gz → 0.11.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {typedparser-0.11.2 → typedparser-0.11.3}/PKG-INFO +2 -1
- {typedparser-0.11.2 → typedparser-0.11.3}/README.md +1 -0
- {typedparser-0.11.2 → typedparser-0.11.3}/src/typedparser/__init__.py +1 -1
- {typedparser-0.11.2 → typedparser-0.11.3}/src/typedparser/_typedattr.py +1 -1
- {typedparser-0.11.2 → typedparser-0.11.3}/src/typedparser.egg-info/PKG-INFO +2 -1
- {typedparser-0.11.2 → typedparser-0.11.3}/LICENSE +0 -0
- {typedparser-0.11.2 → typedparser-0.11.3}/pyproject.toml +0 -0
- {typedparser-0.11.2 → typedparser-0.11.3}/requirements.txt +0 -0
- {typedparser-0.11.2 → typedparser-0.11.3}/setup.cfg +0 -0
- {typedparser-0.11.2 → typedparser-0.11.3}/src/typedparser/_typedparser.py +0 -0
- {typedparser-0.11.2 → typedparser-0.11.3}/src/typedparser/custom_format.py +0 -0
- {typedparser-0.11.2 → typedparser-0.11.3}/src/typedparser/funcs.py +0 -0
- {typedparser-0.11.2 → typedparser-0.11.3}/src/typedparser/objects.py +0 -0
- {typedparser-0.11.2 → typedparser-0.11.3}/src/typedparser.egg-info/SOURCES.txt +0 -0
- {typedparser-0.11.2 → typedparser-0.11.3}/src/typedparser.egg-info/dependency_links.txt +0 -0
- {typedparser-0.11.2 → typedparser-0.11.3}/src/typedparser.egg-info/requires.txt +0 -0
- {typedparser-0.11.2 → typedparser-0.11.3}/src/typedparser.egg-info/top_level.txt +0 -0
- {typedparser-0.11.2 → typedparser-0.11.3}/src/typedparser.egg-info/zip-safe +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: typedparser
|
|
3
|
-
Version: 0.11.
|
|
3
|
+
Version: 0.11.3
|
|
4
4
|
Summary: Extension for python argparse with typehints and typechecks.
|
|
5
5
|
Author: simon-ging
|
|
6
6
|
License: Apache-2.0
|
|
@@ -150,6 +150,7 @@ print(attrs_from_dict(CfgNested, {"sub_cfg": {"foo": 1, "bar": 2}}))
|
|
|
150
150
|
the output will be a tuple
|
|
151
151
|
* Raise errors if types cannot be matched, there are unknown fields in the input or
|
|
152
152
|
abstract annotation types are used (e.g. Sequence)
|
|
153
|
+
* Set `_allow_extra_keys = True` in the class definition to allow unknown fields in the input
|
|
153
154
|
|
|
154
155
|
### Non-strict mode
|
|
155
156
|
|
|
@@ -123,6 +123,7 @@ print(attrs_from_dict(CfgNested, {"sub_cfg": {"foo": 1, "bar": 2}}))
|
|
|
123
123
|
the output will be a tuple
|
|
124
124
|
* Raise errors if types cannot be matched, there are unknown fields in the input or
|
|
125
125
|
abstract annotation types are used (e.g. Sequence)
|
|
126
|
+
* Set `_allow_extra_keys = True` in the class definition to allow unknown fields in the input
|
|
126
127
|
|
|
127
128
|
### Non-strict mode
|
|
128
129
|
|
|
@@ -229,7 +229,7 @@ def _attrs_from_dict(
|
|
|
229
229
|
|
|
230
230
|
# handle unknown fields
|
|
231
231
|
if len(nonmatching_input) > 0 and not skip_unknowns:
|
|
232
|
-
if strict:
|
|
232
|
+
if strict and not getattr(cls, "_allow_extra_keys", False):
|
|
233
233
|
raise TypeError(
|
|
234
234
|
f"Keys in input {list(nonmatching_input.keys())} not defined "
|
|
235
235
|
f"for class {cls} with attributes {sorted(all_att_names)}"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: typedparser
|
|
3
|
-
Version: 0.11.
|
|
3
|
+
Version: 0.11.3
|
|
4
4
|
Summary: Extension for python argparse with typehints and typechecks.
|
|
5
5
|
Author: simon-ging
|
|
6
6
|
License: Apache-2.0
|
|
@@ -150,6 +150,7 @@ print(attrs_from_dict(CfgNested, {"sub_cfg": {"foo": 1, "bar": 2}}))
|
|
|
150
150
|
the output will be a tuple
|
|
151
151
|
* Raise errors if types cannot be matched, there are unknown fields in the input or
|
|
152
152
|
abstract annotation types are used (e.g. Sequence)
|
|
153
|
+
* Set `_allow_extra_keys = True` in the class definition to allow unknown fields in the input
|
|
153
154
|
|
|
154
155
|
### Non-strict mode
|
|
155
156
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|