From c9d3414be7652c8b75ec8a5a037760950557b1bc Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Wed, 14 Aug 2024 21:22:49 +0100 Subject: [PATCH] Better typing for `ObjType` --- sphinx/domains/__init__.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sphinx/domains/__init__.py b/sphinx/domains/__init__.py index 5f716ab61b7..ef3b5e90ade 100644 --- a/sphinx/domains/__init__.py +++ b/sphinx/domains/__init__.py @@ -53,11 +53,10 @@ class ObjType: 'searchprio': 1, } - def __init__(self, lname: str, *roles: Any, **attrs: Any) -> None: - self.lname = lname - self.roles: tuple = roles - self.attrs: dict = self.known_attrs.copy() - self.attrs.update(attrs) + def __init__(self, lname: str, /, *roles: Any, **attrs: Any) -> None: + self.lname: str = lname + self.roles: tuple[Any, ...] = roles + self.attrs: dict[str, Any] = self.known_attrs | attrs class Domain: