Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion playwright/_impl/_impl_to_api_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ def from_impl_list(self, items: List[Any]) -> List[Any]:
def from_impl_dict(self, map: Dict[str, Any]) -> Dict[str, Any]:
return {name: self.from_impl(value) for name, value in map.items()}

def to_impl(self, obj: Any, visited: Map[Any, Union[List, Dict]] = Map()) -> Any:
def to_impl(
self, obj: Any, visited: Optional[Map[Any, Union[List, Dict]]] = None
) -> Any:
if visited is None:
visited = Map()
try:
if not obj:
return obj
Expand Down
8 changes: 6 additions & 2 deletions playwright/_impl/_js_handle.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,10 @@ async def json_value(self) -> Any:


def serialize_value(
value: Any, handles: List[JSHandle], visitor_info: VisitorInfo = VisitorInfo()
value: Any, handles: List[JSHandle], visitor_info: Optional[VisitorInfo] = None
) -> Any:
if visitor_info is None:
visitor_info = VisitorInfo()
if isinstance(value, JSHandle):
h = len(handles)
handles.append(value._channel)
Expand Down Expand Up @@ -160,7 +162,9 @@ def serialize_argument(arg: Serializable = None) -> Any:
return dict(value=value, handles=handles)


def parse_value(value: Any, refs: Dict[int, Any] = {}) -> Any:
def parse_value(value: Any, refs: Optional[Dict[int, Any]] = None) -> Any:
if refs is None:
refs = {}
if value is None:
return None
if isinstance(value, dict):
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ ignore = ["tests/async/", "scripts/", "examples/"]
pythonVersion = "3.7"
reportMissingImports = false
reportTypedDictNotRequiredAccess = false
reportCallInDefaultInitializer = true