This makes comments from type checkers clearer in this case, since the type is
clear before it is first assignment, but what is assigned to the object comes
from different functions.
def from_json(cls, s: Union[str, dict[str, Any], SupportsRead[str], SupportsRead[bytes]]) -> "Args":
"""Instantiate a Args object from a (partial) JSON dump."""
+ j: dict[str, Any]
if isinstance(s, str):
j = json.loads(s)
elif isinstance(s, dict):
s: Union[str, dict[str, Any], SupportsRead[str], SupportsRead[bytes]],
) -> dict[str, Any]:
"""Instantiate a Config object from a (partial) JSON dump."""
+
+ j: dict[str, Any]
if isinstance(s, str):
j = json.loads(s)
elif isinstance(s, dict):