diff options
author | danieleades <33452915+danieleades@users.noreply.github.com> | 2022-08-28 21:17:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-28 21:17:14 +0100 |
commit | 5e9550c78e3421dd7dcab037021d996841178f67 (patch) | |
tree | 601e5f52f4324ea96f5386db32e5952eaf1b0052 /sphinx/domains/cpp.py | |
parent | f56e61d1a1a83db1fb95502d39ea830284c0a0d9 (diff) | |
download | sphinx-git-5e9550c78e3421dd7dcab037021d996841178f67.tar.gz |
Fix more strict static typing errors (#10681)
Diffstat (limited to 'sphinx/domains/cpp.py')
-rw-r--r-- | sphinx/domains/cpp.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/sphinx/domains/cpp.py b/sphinx/domains/cpp.py index 3dedb49c1..380388c83 100644 --- a/sphinx/domains/cpp.py +++ b/sphinx/domains/cpp.py @@ -3646,7 +3646,9 @@ class ASTTemplateParamTemplateType(ASTTemplateParam): def get_identifier(self) -> ASTIdentifier: return self.data.get_identifier() - def get_id(self, version: int, objectType: str = None, symbol: "Symbol" = None) -> str: + def get_id( + self, version: int, objectType: Optional[str] = None, symbol: Optional["Symbol"] = None + ) -> str: assert version >= 2 # this is not part of the normal name mangling in C++ if symbol: @@ -4227,14 +4229,15 @@ class Symbol: else: return super().__setattr__(key, value) - def __init__(self, parent: "Symbol", identOrOp: Union[ASTIdentifier, ASTOperator], - templateParams: Union[ASTTemplateParams, ASTTemplateIntroduction], - templateArgs: Any, declaration: ASTDeclaration, - docname: str, line: int) -> None: + def __init__(self, parent: Optional["Symbol"], + identOrOp: Union[ASTIdentifier, ASTOperator, None], + templateParams: Union[ASTTemplateParams, ASTTemplateIntroduction, None], + templateArgs: Any, declaration: Optional[ASTDeclaration], + docname: Optional[str], line: Optional[int]) -> None: self.parent = parent # declarations in a single directive are linked together - self.siblingAbove: Symbol = None - self.siblingBelow: Symbol = None + self.siblingAbove: Optional[Symbol] = None + self.siblingBelow: Optional[Symbol] = None self.identOrOp = identOrOp # Ensure the same symbol for `A` is created for: # |