We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cab8b61 commit c3a5009Copy full SHA for c3a5009
1 file changed
unpythonic/typecheck.py
@@ -303,8 +303,9 @@ def iscollection(statictype, runtimetype):
303
typeargs = (int,)
304
else:
305
typeargs = T.__args__
306
+ # Python 3.6: consistent behavior with 3.7+, which use an unconstrained TypeVar T.
307
if typeargs is None:
- raise TypeError("Missing mandatory element type argument of `{}`".format(statictype))
308
+ typeargs = (typing.TypeVar("T"))
309
# Judging by the docs, List takes one type argument. The rest are similar.
310
# https://docs.python.org/3/library/typing.html#typing.List
311
assert len(typeargs) == 1
0 commit comments