Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite34eb85

Browse files
committed
Vendor removed typing._allowed_types
1 parent4f47303 commite34eb85

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎nbs/01_basics.ipynb‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@
6060
"outputs": [],
6161
"source": [
6262
"#|export\n",
63-
"defaults = SimpleNamespace()"
63+
"defaults = SimpleNamespace()\n",
64+
"\n",
65+
"_allowed_types = (types.FunctionType, types.BuiltinFunctionType,\n",
66+
" types.MethodType, types.ModuleType,\n",
67+
" WrapperDescriptorType, MethodWrapperType, MethodDescriptorType)"
6468
]
6569
},
6670
{
@@ -1870,7 +1874,7 @@
18701874
"\n",
18711875
"def type_hints(f):\n",
18721876
"\"Like `typing.get_type_hints` but returns `{}` if not allowed type\"\n",
1873-
" if not isinstance(f,typing._allowed_types): return {}\n",
1877+
" if not isinstance(f, _allowed_types): return {}\n",
18741878
" ann,glb,loc = get_annotations_ex(f)\n",
18751879
" return {k:_eval_type(v,glb,loc) for k,v in ann.items()}"
18761880
]

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp