Skip to content

Commit

Permalink
use black lint to format
Browse files Browse the repository at this point in the history
  • Loading branch information
Oghenemarho Onothoja authored and Oghenemarho Onothoja committed Jul 23, 2023
1 parent 7c94403 commit b2864bc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
19 changes: 12 additions & 7 deletions functional/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from functional.execution import ExecutionStrategies


TSequence = TypeVar("TSequence", covariant=True, bound="Sequence")
TSequence = TypeVar("TSequence", covariant=True, bound="Sequence")


class Sequence(object):
Expand All @@ -39,7 +39,12 @@ class Sequence(object):
"""

def __init__(
self, sequence: TSequence, transform=None, engine: ExecutionEngine=None, max_repr_items: int=None, no_wrap: bool=False
self,
sequence: TSequence,
transform=None,
engine: ExecutionEngine = None,
max_repr_items: int = None,
no_wrap: bool = False,
):
# pylint: disable=protected-access
"""
Expand Down Expand Up @@ -230,7 +235,7 @@ def cache(self, delete_lineage=False):
self._lineage = Lineage(engine=self.engine)
return self

def head(self, no_wrap: bool=False):
def head(self, no_wrap: bool = False):
"""
Returns the first element of the sequence.
Expand All @@ -252,7 +257,7 @@ def head(self, no_wrap: bool=False):
else:
return _wrap(self.take(1)[0])

def first(self, no_wrap: bool=False):
def first(self, no_wrap: bool = False):
"""
Returns the first element of the sequence.
Expand All @@ -271,7 +276,7 @@ def first(self, no_wrap: bool=False):
"""
return self.head(no_wrap=no_wrap)

def head_option(self, no_wrap: bool=False):
def head_option(self, no_wrap: bool = False):
"""
Returns the first element of the sequence or None, if the sequence is empty.
Expand All @@ -288,7 +293,7 @@ def head_option(self, no_wrap: bool=False):
return None
return self.head(no_wrap=no_wrap)

def last(self, no_wrap: bool=False):
def last(self, no_wrap: bool = False):
"""
Returns the last element of the sequence.
Expand All @@ -310,7 +315,7 @@ def last(self, no_wrap: bool=False):
else:
return _wrap(self.sequence[-1])

def last_option(self, no_wrap: bool=False):
def last_option(self, no_wrap: bool = False):
"""
Returns the last element of the sequence or None, if the sequence is empty.
Expand Down
2 changes: 1 addition & 1 deletion functional/transformations.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def distinct_by(sequence):
return Transformation(f"distinct_by({name(func)})", distinct_by, None)


def sorted_t(key=None, reverse: bool=False):
def sorted_t(key=None, reverse: bool = False):
"""
Transformation for Sequence.sorted
:param key: key to sort by
Expand Down

0 comments on commit b2864bc

Please sign in to comment.