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 @@ -59,18 +59,17 @@ def stdlib_list(version: str | None = None) -> list[str]:
59
59
60
60
data = pkgutil .get_data ("stdlib_list" , module_list_file ).decode () # type: ignore[union-attr]
61
61
62
- result = [y for y in [ x . strip () for x in data .splitlines ()] if y ]
62
+ result = [y for x in data .splitlines () if ( y := x . strip ()) ]
63
63
64
64
return result
65
65
66
66
67
67
@lru_cache (maxsize = 16 )
68
- def _stdlib_list_with_cache (version : str | None = None ) -> list [str ]:
68
+ def _stdlib_list_with_cache (version : str | None = None ) -> frozenset [str ]:
69
69
"""Internal cached version of `stdlib_list`"""
70
- return stdlib_list (version = version )
70
+ return frozenset ( stdlib_list (version = version ) )
71
71
72
72
73
- @lru_cache (maxsize = 256 )
74
73
def in_stdlib (module_name : str , version : str | None = None ) -> bool :
75
74
"""
76
75
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