Skip to content

Commit 0ada04f

Browse files
authored
chore: follow-up to reduce memory footprint (#1625)
1 parent f123f8f commit 0ada04f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

playwright/_impl/_js_handle.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# limitations under the License.
1414

1515
import math
16-
from dataclasses import dataclass
1716
from datetime import datetime
1817
from typing import TYPE_CHECKING, Any, Dict, List, Optional
1918
from urllib.parse import ParseResult, urlparse, urlunparse
@@ -28,10 +27,13 @@
2827
Serializable = Any
2928

3029

31-
@dataclass
3230
class VisitorInfo:
33-
visited: Map[Any, int] = Map()
34-
last_id: int = 0
31+
visited: Map[Any, int]
32+
last_id: int
33+
34+
def __init__(self) -> None:
35+
self.visited = Map()
36+
self.last_id = 0
3537

3638
def visit(self, obj: Any) -> int:
3739
assert obj not in self.visited

0 commit comments

Comments
 (0)