Skip to content

Commit b118264

Browse files
committed
More PR fixes
1 parent 0b56ac4 commit b118264

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

frozenlist/__init__.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@
66

77
__version__ = "1.8.1.dev0"
88

9-
__all__ = (
10-
"FrozenList",
11-
"PyFrozenList",
12-
) # type: Tuple[str, ...]
9+
__all__ = ("FrozenList", "PyFrozenList") # type: Tuple[str, ...]
1310

1411

1512
NO_EXTENSIONS = bool(os.environ.get("FROZENLIST_NO_EXTENSIONS")) # type: bool
@@ -104,7 +101,11 @@ def __reduce__(self):
104101
)
105102

106103

107-
def _reconstruct_pyfrozenlist(items: list[object], frozen: bool) -> "PyFrozenList":
104+
# Store a reference to the pure Python implementation before it's potentially replaced
105+
PyFrozenList = FrozenList
106+
107+
108+
def _reconstruct_pyfrozenlist(items: list[object], frozen: bool) -> PyFrozenList:
108109
"""Helper function to reconstruct the pure Python FrozenList during unpickling.
109110
This function is needed since otherwise the class renaming confuses pickle."""
110111
fl = PyFrozenList(items)
@@ -113,10 +114,6 @@ def _reconstruct_pyfrozenlist(items: list[object], frozen: bool) -> "PyFrozenLis
113114
return fl
114115

115116

116-
# Store a reference to the pure Python implementation before it's potentially replaced
117-
PyFrozenList = FrozenList
118-
119-
120117
if not NO_EXTENSIONS:
121118
try:
122119
from ._frozenlist import FrozenList as CFrozenList # type: ignore

0 commit comments

Comments
 (0)