diff options
| author | Jon Dufresne <jon.dufresne@gmail.com> | 2018-09-11 06:48:35 -0700 |
|---|---|---|
| committer | Jon Dufresne <jon.dufresne@gmail.com> | 2018-09-11 07:07:01 -0700 |
| commit | 490e4aed4145659dab000e86269bd7a3dc686318 (patch) | |
| tree | 87b32f22ae1ff41b03877a68bbb8ab4f1c2c9ab7 /sphinx/domains | |
| parent | 844a3a5c226ff8891a1ce139f10ac92157c75da5 (diff) | |
| download | sphinx-git-490e4aed4145659dab000e86269bd7a3dc686318.tar.gz | |
Remove unnecessary object from class definitions
In Python 3, all classes are new-style classes. The object in the
definition is redundant and unnecessary.
Diffstat (limited to 'sphinx/domains')
| -rw-r--r-- | sphinx/domains/__init__.py | 6 | ||||
| -rw-r--r-- | sphinx/domains/cpp.py | 12 | ||||
| -rw-r--r-- | sphinx/domains/python.py | 4 |
3 files changed, 11 insertions, 11 deletions
diff --git a/sphinx/domains/__init__.py b/sphinx/domains/__init__.py index 41db13cb6..e8c3a59dd 100644 --- a/sphinx/domains/__init__.py +++ b/sphinx/domains/__init__.py @@ -28,7 +28,7 @@ if False: from sphinx.util.typing import RoleFunction # NOQA -class ObjType(object): +class ObjType: """ An ObjType is the description for a type of object that a domain can document. In the object_types attribute of Domain subclasses, object type @@ -55,7 +55,7 @@ class ObjType(object): self.attrs.update(attrs) -class Index(object): +class Index: """ An Index is the description for a domain-specific index. To add an index to a domain, subclass Index, overriding the three name attributes: @@ -113,7 +113,7 @@ class Index(object): raise NotImplementedError -class Domain(object): +class Domain: """ A Domain is meant to be a group of "object" description directives for objects of a similar nature, and corresponding roles to create references to diff --git a/sphinx/domains/cpp.py b/sphinx/domains/cpp.py index 5d556e777..9c797cd36 100644 --- a/sphinx/domains/cpp.py +++ b/sphinx/domains/cpp.py @@ -3592,7 +3592,7 @@ class ASTNamespace(ASTBase): self.templatePrefix = templatePrefix -class SymbolLookupResult(object): +class SymbolLookupResult: def __init__(self, symbols, parentSymbol, identOrOp, templateParams, templateArgs): # type: (Iterator[Symbol], Symbol, Union[ASTIdentifier, ASTOperator], Any, ASTTemplateArgs) -> None # NOQA self.symbols = symbols @@ -3602,7 +3602,7 @@ class SymbolLookupResult(object): self.templateArgs = templateArgs -class Symbol(object): +class Symbol: debug_lookup = False def _assert_invariants(self): @@ -4293,7 +4293,7 @@ class Symbol(object): return ''.join(res) -class DefinitionParser(object): +class DefinitionParser: # those without signedness and size modifiers # see http://en.cppreference.com/w/cpp/language/types _simple_fundemental_types = ( @@ -6585,7 +6585,7 @@ class CPPXRefRole(XRefRole): return title, target -class CPPExprRole(object): +class CPPExprRole: def __init__(self, asCode): if asCode: # render the expression as inline code @@ -6597,7 +6597,7 @@ class CPPExprRole(object): self.node_type = nodes.inline def __call__(self, typ, rawtext, text, lineno, inliner, options={}, content=[]): - class Warner(object): + class Warner: def warn(self, msg): inliner.reporter.warning(msg, line=lineno) text = utils.unescape(text).replace('\n', ' ') @@ -6716,7 +6716,7 @@ class CPPDomain(Domain): target, node, contnode, emitWarnings=True): # type: (BuildEnvironment, unicode, Builder, unicode, unicode, nodes.Node, nodes.Node, bool) -> nodes.Node # NOQA - class Warner(object): + class Warner: def warn(self, msg): if emitWarnings: logger.warning(msg, location=node) diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py index fe9bb9090..5f822aeca 100644 --- a/sphinx/domains/python.py +++ b/sphinx/domains/python.py @@ -114,7 +114,7 @@ def _pseudo_parse_arglist(signode, arglist): # This override allows our inline type specifiers to behave like :class: link # when it comes to handling "." and "~" prefixes. -class PyXrefMixin(object): +class PyXrefMixin: def make_xref(self, rolename, # type: unicode domain, # type: unicode @@ -536,7 +536,7 @@ class PyClassmember(PyObject): return '' -class PyDecoratorMixin(object): +class PyDecoratorMixin: """ Mixin for decorator directives. """ |
