Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: follow-up to reduce memory footprint #1625

Merged
merged 1 commit into from
Nov 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 6 additions & 4 deletions playwright/_impl/_js_handle.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# limitations under the License.

import math
from dataclasses import dataclass
from datetime import datetime
from typing import TYPE_CHECKING, Any, Dict, List, Optional
from urllib.parse import ParseResult, urlparse, urlunparse
Expand All @@ -28,10 +27,13 @@
Serializable = Any


@dataclass
class VisitorInfo:
visited: Map[Any, int] = Map()
last_id: int = 0
visited: Map[Any, int]
last_id: int

def __init__(self) -> None:
self.visited = Map()
self.last_id = 0

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