Closed fubuloubu closed 3 years ago
Thanks for the report. You can also solve this with getattr(hint, '__args__', None)
, or better yet, isinstance(getattr(hint, '__args__', None), Iterable)
.
This made me realise I've been careless about Python 3.6 hinting in general. Since v0.8, subscripting Internal
or Hashed
as objects (instead of string literals or from future import annotations
) will raise a TypeError
because __class_getitem__
is not recognised.
Good point, made that suggested change in e60e376
Except you missed the import!
I'm not quite sure where this is happening in my application (to be able to give a MWE) but there appears to be an issue with using this library in Py3.6 (before the inclusion of
dataclasses
intostdlib
):I think the breaking assumption is that
hint.__args__
is notNone
in this case.