File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change 7
7
* ``attrs `` and dataclass structuring is now ~25% faster.
8
8
* Fix an issue structuring bare ``typing.List `` s on Pythons lower than 3.9.
9
9
(`#209 <https://github.com/python-attrs/cattrs/issues/209 >`_)
10
+ * Fix structuring bare generics on Pythons lower than 3.9.
11
+ (`https://github.com/python-attrs/cattrs/issues/218 `)
10
12
11
13
1.10.0 (2022-01-04)
12
14
-------------------
Original file line number Diff line number Diff line change @@ -168,13 +168,15 @@ def is_mapping(type):
168
168
bare_mutable_seq_args = TypingMutableSequence .__args__
169
169
170
170
def is_bare (type ):
171
- args = type .__args__
171
+ # Lower-cased generics in 3.7-8 do not have `__args__` attribute.
172
+ args = getattr (type , "__args__" , None )
172
173
return (
173
174
args == bare_list_args
174
175
or args == bare_seq_args
175
176
or args == bare_mapping_args
176
177
or args == bare_dict_args
177
178
or args == bare_mutable_seq_args
179
+ or args is None
178
180
)
179
181
180
182
def is_counter (type ):
You can’t perform that action at this time.
0 commit comments