Skip to content

Commit

Permalink
Del (object) from 10 inc tools/sapp/sapp/db.py
Browse files Browse the repository at this point in the history
Summary: Python3 makes the use of `(object)` in class inheritance unnecessary. Let's modernize our code by eliminating this.

Reviewed By: arthaud

Differential Revision: D48957950

fbshipit-source-id: 903b2e2801877b0375e282cb15284570e22406dd
  • Loading branch information
r-barnes authored and facebook-github-bot committed Sep 5, 2023
1 parent d21ff86 commit 72a12ad
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion sapp/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class DBType(sqlalchemy.Enum):
MEMORY = "memory"


class DB(object):
class DB:
"""Interact with the database type requested"""

"""File-based DB when using SQLITE"""
Expand Down
8 changes: 4 additions & 4 deletions sapp/db_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
# the real id.


class DBID(object):
class DBID:
__slots__ = ["_id", "is_new", "local_id"]

# Temporary IDs that are local per run (local_id) are assigned for each
Expand Down Expand Up @@ -161,7 +161,7 @@ def load_dialect_impl(self, dialect: Dialect):
return self.impl


class PrepareMixin(object):
class PrepareMixin:
@classmethod
def prepare(
cls,
Expand Down Expand Up @@ -292,7 +292,7 @@ def _merge_assocs(cls, database: DB, items, id1, id2):
# __slots__, which is more efficient. Both of these mixins can be replaced when
# we have dynamically created classes with the slots set. But until then,
# prefer RecordMixin unless you need to change fields after creation.
class RecordMixin(object):
class RecordMixin:
# pyre-fixme[4]: Attribute must be annotated.
_record = None

Expand All @@ -317,7 +317,7 @@ def to_dict(cls, obj):
return obj._asdict()


class MutableRecordMixin(object):
class MutableRecordMixin:
@classmethod
# pyre-fixme[2]: Parameter must be annotated.
def Record(cls, **kwargs) -> Munch:
Expand Down
2 changes: 1 addition & 1 deletion sapp/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
log = logging.getLogger("sapp")


class retryable(object):
class retryable:
def __init__(
self, num_tries: int = 1, retryable_exs: Optional[List[Any]] = None
) -> None:
Expand Down
2 changes: 1 addition & 1 deletion sapp/json_diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def _parse_file(
return (path, dict(entries))


class JSONDiagnostics(object):
class JSONDiagnostics:
def __init__(
self,
analysis_output: AnalysisOutput,
Expand Down
2 changes: 1 addition & 1 deletion sapp/pipeline/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def run(self, input: T_in, summary: Summary) -> Tuple[T_out, Summary]:
raise NotImplementedError("PipelineStep.run is abstract")


class Pipeline(object):
class Pipeline:
# pyre-fixme[3]: Return type must be annotated.
# pyre-fixme[2]: Parameter annotation cannot contain `Any`.
def __init__(self, steps: List[PipelineStep[Any, Any]]):
Expand Down
4 changes: 2 additions & 2 deletions sapp/sharded_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from typing import List


class ShardedFileComponents(object):
class ShardedFileComponents:
"""
Splits a sharded file name or pattern into its components:
- directory
Expand Down Expand Up @@ -78,7 +78,7 @@ def is_at_star_pattern(self) -> bool:
return self.shard_total == -1 and self.shard_index == -1


class ShardedFile(object):
class ShardedFile:
"""A sharded file object represents a set of files sharded according to the
following pattern:
Expand Down
2 changes: 1 addition & 1 deletion sapp/trace_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
LeafIDToDepthMap = Dict[int, Optional[int]]


class TraceGraph(object):
class TraceGraph:
"""Represents a graph of the Zoncolan trace steps. Nodes of the graph are
the issues, preconditions, postconditions, sources and sinks. Edges are
the the assocs, and for pre/postconditions, the map of 'caller->callee'
Expand Down

0 comments on commit 72a12ad

Please sign in to comment.