Skip to content

Commit b4e7c3e

Browse files
Oghenemarho OnothojaOghenemarho Onothoja
Oghenemarho Onothoja
authored and
Oghenemarho Onothoja
committed
use black lint to format
1 parent bc8a672 commit b4e7c3e

File tree

4 files changed

+25
-20
lines changed

4 files changed

+25
-20
lines changed

docs/conf.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@
4848
master_doc = "index"
4949

5050
# General information about the project.
51-
project = u"PyFunctional"
52-
copyright = u"2019, Pedro Rodriguez"
53-
author = u"Pedro Rodriguez"
51+
project = "PyFunctional"
52+
copyright = "2019, Pedro Rodriguez"
53+
author = "Pedro Rodriguez"
5454

5555
# The version info for the project you're documenting, acts as replacement for
5656
# |version| and |release|, also used in various other places throughout the
@@ -224,8 +224,8 @@
224224
(
225225
master_doc,
226226
"PyFunctional.tex",
227-
u"PyFunctional Documentation",
228-
u"Pedro Rodriguez",
227+
"PyFunctional Documentation",
228+
"Pedro Rodriguez",
229229
"manual",
230230
),
231231
]
@@ -255,7 +255,7 @@
255255

256256
# One entry per manual page. List of tuples
257257
# (source start file, name, description, authors, manual section).
258-
man_pages = [(master_doc, "pyfunctional", u"PyFunctional Documentation", [author], 1)]
258+
man_pages = [(master_doc, "pyfunctional", "PyFunctional Documentation", [author], 1)]
259259

260260
# If true, show URL addresses after external links.
261261
# man_show_urls = False
@@ -270,7 +270,7 @@
270270
(
271271
master_doc,
272272
"PyFunctional",
273-
u"PyFunctional Documentation",
273+
"PyFunctional Documentation",
274274
author,
275275
"PyFunctional",
276276
"One line description of project.",

functional/pipeline.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
from functional.execution import ExecutionStrategies
3030

3131

32-
TSequence = TypeVar("TSequence", covariant=True, bound="Sequence")
32+
TSequence = TypeVar("TSequence", covariant=True, bound="Sequence")
3333

3434

3535
class Sequence(object):
@@ -39,7 +39,12 @@ class Sequence(object):
3939
"""
4040

4141
def __init__(
42-
self, sequence: TSequence, transform=None, engine: ExecutionEngine=None, max_repr_items: int=None, no_wrap: bool=False
42+
self,
43+
sequence: TSequence,
44+
transform=None,
45+
engine: ExecutionEngine = None,
46+
max_repr_items: int = None,
47+
no_wrap: bool = False,
4348
):
4449
# pylint: disable=protected-access
4550
"""
@@ -230,7 +235,7 @@ def cache(self, delete_lineage=False):
230235
self._lineage = Lineage(engine=self.engine)
231236
return self
232237

233-
def head(self, no_wrap: bool=False):
238+
def head(self, no_wrap: bool = False):
234239
"""
235240
Returns the first element of the sequence.
236241
@@ -252,7 +257,7 @@ def head(self, no_wrap: bool=False):
252257
else:
253258
return _wrap(self.take(1)[0])
254259

255-
def first(self, no_wrap: bool=False):
260+
def first(self, no_wrap: bool = False):
256261
"""
257262
Returns the first element of the sequence.
258263
@@ -271,7 +276,7 @@ def first(self, no_wrap: bool=False):
271276
"""
272277
return self.head(no_wrap=no_wrap)
273278

274-
def head_option(self, no_wrap: bool=False):
279+
def head_option(self, no_wrap: bool = False):
275280
"""
276281
Returns the first element of the sequence or None, if the sequence is empty.
277282
@@ -288,7 +293,7 @@ def head_option(self, no_wrap: bool=False):
288293
return None
289294
return self.head(no_wrap=no_wrap)
290295

291-
def last(self, no_wrap: bool=False):
296+
def last(self, no_wrap: bool = False):
292297
"""
293298
Returns the last element of the sequence.
294299
@@ -310,7 +315,7 @@ def last(self, no_wrap: bool=False):
310315
else:
311316
return _wrap(self.sequence[-1])
312317

313-
def last_option(self, no_wrap: bool=False):
318+
def last_option(self, no_wrap: bool = False):
314319
"""
315320
Returns the last element of the sequence or None, if the sequence is empty.
316321

functional/test/test_functional.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,17 +1074,17 @@ def my_zip(it):
10741074

10751075
@extend
10761076
def square(it):
1077-
return [i ** 2 for i in it]
1077+
return [i**2 for i in it]
10781078

10791079
result = seq.range(100).square().list()
1080-
expected = [i ** 2 for i in range(100)]
1080+
expected = [i**2 for i in range(100)]
10811081
self.assertEqual(result, expected)
10821082

10831083
name = "PARALLEL_SQUARE"
10841084

10851085
@extend(parallel=True, name=name)
10861086
def square_parallel(it):
1087-
return [i ** 2 for i in it]
1087+
return [i**2 for i in it]
10881088

10891089
result = seq.range(100).square_parallel()
10901090
self.assertEqual(result.sum(), sum(expected))
@@ -1114,8 +1114,8 @@ def toarray(it):
11141114
expected = array.array("f", range(10))
11151115
self.assertEqual(result, expected)
11161116

1117-
result = seq.range(10).map(lambda x: x ** 2).toarray()
1118-
expected = array.array("f", [i ** 2 for i in range(10)])
1117+
result = seq.range(10).map(lambda x: x**2).toarray()
1118+
expected = array.array("f", [i**2 for i in range(10)])
11191119
self.assertEqual(result, expected)
11201120

11211121
# a more complex example combining all above

functional/transformations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def distinct_by(sequence):
172172
return Transformation("distinct_by({0})".format(name(func)), distinct_by, None)
173173

174174

175-
def sorted_t(key=None, reverse: bool=False):
175+
def sorted_t(key=None, reverse: bool = False):
176176
"""
177177
Transformation for Sequence.sorted
178178
:param key: key to sort by

0 commit comments

Comments
 (0)