Pyupgrade to python3.8 (#3616)

* Upgrade to Python 3.8 syntax

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
Christian Clauss
2020-10-21 12:46:14 +02:00
committed by GitHub
parent 74233022a0
commit 9b95e4f662
21 changed files with 38 additions and 33 deletions

View File

@ -7,7 +7,7 @@ from collections.abc import Sequence
from queue import Queue
class SegmentTreeNode(object):
class SegmentTreeNode:
def __init__(self, start, end, val, left=None, right=None):
self.start = start
self.end = end
@ -17,10 +17,10 @@ class SegmentTreeNode(object):
self.right = right
def __str__(self):
return "val: %s, start: %s, end: %s" % (self.val, self.start, self.end)
return f"val: {self.val}, start: {self.start}, end: {self.end}"
class SegmentTree(object):
class SegmentTree:
"""
>>> import operator
>>> num_arr = SegmentTree([2, 1, 5, 3, 4], operator.add)