python: Mark dict parameters with defaults as read-only.

Found by semgrep 0.115 more accurately applying the rule added in
commit 0d6c771baf (#15349).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2022-10-06 02:56:48 -07:00
committed by Tim Abbott
parent 3f010bbcc4
commit 47c5deeccd
14 changed files with 50 additions and 44 deletions

View File

@@ -14,6 +14,7 @@ from typing import (
Iterable,
Iterator,
List,
Mapping,
Optional,
Tuple,
TypeVar,
@@ -305,7 +306,7 @@ class HostRequestMock(HttpRequest):
def __init__(
self,
post_data: Dict[str, Any] = {},
post_data: Mapping[str, Any] = {},
user_profile: Union[UserProfile, None] = None,
remote_server: Optional[RemoteZulipServer] = None,
host: str = settings.EXTERNAL_HOST,