C, improve type annotations with related refactoring

This commit is contained in:
Jakob Lykke Andersen 2020-03-16 19:13:42 +01:00
parent 6ec42b071e
commit e4e5ee8598
3 changed files with 580 additions and 485 deletions

File diff suppressed because it is too large Load Diff

View File

@ -33,7 +33,7 @@ from sphinx.transforms import SphinxTransform
from sphinx.transforms.post_transforms import ReferencesResolver
from sphinx.util import logging
from sphinx.util.cfamily import (
NoOldIdError, ASTBase, verify_description_mode, StringifyTransform,
NoOldIdError, ASTBaseBase, verify_description_mode, StringifyTransform,
BaseParser, DefinitionError, UnsupportedMultiCharacterCharLiteral,
identifier_re, anon_identifier_re, integer_literal_re, octal_literal_re,
hex_literal_re, binary_literal_re, float_literal_re,
@ -555,6 +555,10 @@ class _DuplicateSymbolError(Exception):
return "Internal C++ duplicate symbol error:\n%s" % self.symbol.dump(0)
class ASTBase(ASTBaseBase):
pass
################################################################################
# Attributes
################################################################################

View File

@ -77,7 +77,7 @@ class NoOldIdError(Exception):
return str(self)
class ASTBase:
class ASTBaseBase:
def __eq__(self, other: Any) -> bool:
if type(self) is not type(other):
return False