File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -58,18 +58,17 @@ def stdlib_list(version: str | None = None) -> list[str]:
58
58
59
59
data = pkgutil .get_data ("stdlib_list" , module_list_file ).decode () # type: ignore[union-attr]
60
60
61
- result = [y for y in [ x . strip () for x in data .splitlines ()] if y ]
61
+ result = [y for x in data .splitlines () if ( y := x . strip ()) ]
62
62
63
63
return result
64
64
65
65
66
66
@lru_cache (maxsize = 16 )
67
- def _stdlib_list_with_cache (version : str | None = None ) -> list [str ]:
67
+ def _stdlib_list_with_cache (version : str | None = None ) -> frozenset [str ]:
68
68
"""Internal cached version of `stdlib_list`"""
69
- return stdlib_list (version = version )
69
+ return frozenset ( stdlib_list (version = version ) )
70
70
71
71
72
- @lru_cache (maxsize = 256 )
73
72
def in_stdlib (module_name : str , version : str | None = None ) -> bool :
74
73
"""
75
74
Return a ``bool`` indicating if module ``module_name`` is in the list of stdlib
You can’t perform that action at this time.
0 commit comments