From eecc983b99acc06e3026d179a439635b279a414c Mon Sep 17 00:00:00 2001 From: Simon Forman Date: Thu, 8 Sep 2022 10:37:46 -0700 Subject: [PATCH] blacken --- implementations/Python/simplejoy.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/implementations/Python/simplejoy.py b/implementations/Python/simplejoy.py index f2e49b1..51abe7a 100755 --- a/implementations/Python/simplejoy.py +++ b/implementations/Python/simplejoy.py @@ -187,7 +187,7 @@ def concat(quote, expression): def get_n_items(n, stack): ''' - Return items and remainder of stack. + Return n items and remainder of stack. Raise StackUnderflowError if there are fewer than n items on the stack. ''' assert n > 0, repr(n) @@ -197,7 +197,9 @@ def get_n_items(n, stack): try: item, stack = stack except ValueError: - raise StackUnderflowError('Not enough values on stack.') from None + raise StackUnderflowError( + 'Not enough values on stack.' + ) from None temp.append(item) temp.append(stack) return tuple(temp) @@ -806,7 +808,9 @@ def rest(stack): try: _, s1 = s0 except ValueError: - raise StackUnderflowError('Cannot take rest of empty list.') from None + raise StackUnderflowError( + 'Cannot take rest of empty list.' + ) from None return s1, stack @@ -1235,6 +1239,7 @@ _map2 ≡ [infrst] cons dipd roll< swons ╚═╝ ╚═╝ ╚═╝ ╚══════╝ ╚═════╝╚═╝ ╚═╝╚══════╝ ╚═════╝╚═╝ ╚═╝╚══════╝ ''' + class NotAListError(Exception): ''' Raised when a stack is expected but not received. -- 2.11.0