pyupgrade --py37-plus **/*.py (#1654)

* pyupgrade --py37-plus **/*.py

* fixup! Format Python code with psf/black push
This commit is contained in:
Christian Clauss
2020-01-03 15:25:36 +01:00
committed by John Law
parent 34c808b375
commit 28419cf839
77 changed files with 71 additions and 128 deletions

View File

@ -2,7 +2,7 @@ from random import random
from typing import Tuple
class Node(object):
class Node:
"""
Treap's node
Treap is a binary tree by value and heap by priority
@ -18,11 +18,10 @@ class Node(object):
from pprint import pformat
if self.left is None and self.right is None:
return "'%s: %.5s'" % (self.value, self.prior)
return f"'{self.value}: {self.prior:.5}'"
else:
return pformat(
{"%s: %.5s" % (self.value, self.prior): (self.left, self.right)},
indent=1,
{f"{self.value}: {self.prior:.5}": (self.left, self.right)}, indent=1,
)
def __str__(self):