Skip to content

Commit 6e6959d

Browse files
authored
Remove inheritance from object (#109)
All classes in python3 are new style classes thus already inheriting object, and python2 is not supported already since Jan 2020
1 parent 6110412 commit 6e6959d

File tree

6 files changed

+13
-14
lines changed

6 files changed

+13
-14
lines changed

redisgraph/edge.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from .util import *
44

5-
class Edge(object):
5+
class Edge:
66
"""
77
An edge connecting two nodes.
88
"""
@@ -58,7 +58,7 @@ def __eq__(self, rhs):
5858
# Source and destination nodes should match.
5959
if self.src_node != rhs.src_node:
6060
return False
61-
61+
6262
if self.dest_node != rhs.dest_node:
6363
return False
6464

redisgraph/graph.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from .query_result import QueryResult
44
from .exceptions import VersionMismatchException
55

6-
class Graph(object):
6+
class Graph:
77
"""
88
Graph, collection of nodes and edges.
99
"""
@@ -189,10 +189,10 @@ def execution_plan(self, query, params=None):
189189
Get the execution plan for given query,
190190
GRAPH.EXPLAIN returns an array of operations.
191191
"""
192-
192+
193193
if params is not None:
194194
query = self.build_params_header(params) + query
195-
195+
196196
plan = self.redis_con.execute_command("GRAPH.EXPLAIN", self.name, query, query)
197197
return self._execution_plan_to_string(plan)
198198

@@ -202,7 +202,7 @@ def delete(self):
202202
"""
203203
self._clear_schema()
204204
return self.redis_con.execute_command("GRAPH.DELETE", self.name)
205-
205+
206206
def merge(self, pattern):
207207
"""
208208
Merge pattern.

redisgraph/node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from .util import *
22

3-
class Node(object):
3+
class Node:
44
"""
55
A node within the garph.
66
"""

redisgraph/path.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from .node import Node
22
from .edge import Edge
33

4-
class Path(object):
4+
class Path:
55

66
def __init__(self, nodes, edges):
77
assert(isinstance(nodes, list) and isinstance(edges, list))
@@ -33,7 +33,7 @@ def last_node(self):
3333

3434
def edge_count(self):
3535
return len(self._edges)
36-
36+
3737
def nodes_count(self):
3838
return len(self._nodes)
3939

@@ -64,4 +64,3 @@ def __str__(self):
6464
res += "(" + str(node_id) + ")"
6565
res += ">"
6666
return res
67-

redisgraph/query_result.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
NODES_DELETED, RELATIONSHIPS_DELETED, INDICES_CREATED, INDICES_DELETED,
2121
CACHED_EXECUTION, INTERNAL_EXECUTION_TIME]
2222

23-
class ResultSetColumnTypes(object):
23+
class ResultSetColumnTypes:
2424
COLUMN_UNKNOWN = 0
2525
COLUMN_SCALAR = 1
2626
COLUMN_NODE = 2 # Unused as of RedisGraph v2.1.0, retained for backwards compatibility.
2727
COLUMN_RELATION = 3 # Unused as of RedisGraph v2.1.0, retained for backwards compatibility.
2828

29-
class ResultSetScalarTypes(object):
29+
class ResultSetScalarTypes:
3030
VALUE_UNKNOWN = 0
3131
VALUE_NULL = 1
3232
VALUE_STRING = 2
@@ -38,7 +38,7 @@ class ResultSetScalarTypes(object):
3838
VALUE_NODE = 8
3939
VALUE_PATH = 9
4040

41-
class QueryResult(object):
41+
class QueryResult:
4242

4343
def __init__(self, graph, response):
4444
self.graph = graph

redisgraph/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
def random_string(length=10):
77
"""
8-
Returns a random N chracter long string.
8+
Returns a random N character long string.
99
"""
1010
return ''.join(random.choice(string.ascii_lowercase) for x in range(length))
1111

0 commit comments

Comments
 (0)