Skip to content

Commit

Permalink
use functools partial instead of lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
jborbely committed Aug 19, 2022
1 parent bac94fc commit 0a37ee6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/iterate_through_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""
import os
import sys
from functools import partial
from inspect import (
getmembers,
isfunction,
Expand Down Expand Up @@ -35,9 +36,9 @@
if name in ['comments', 'filename', 'folder', 'save']:
examples.append(item)
elif name == 'item':
examples.append(lambda message=name, fcn=item: fcn(message, items=[1, 2, 3]))
examples.append(partial(item, name, items=[1, 2, 3]))
else:
examples.append(lambda message=name, fcn=item: fcn(message))
examples.append(partial(item, name))

n = len(examples)
for i, example in enumerate(examples, start=1):
Expand Down

0 comments on commit 0a37ee6

Please sign in to comment.