Skip to content

Commit 312c34d

Browse files
committed
Use nested func instead of lambda in builder.py
1 parent 15d57bd commit 312c34d

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/diffpy/srfit/equation/builder.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -662,13 +662,16 @@ def __wrapSrFitOperators():
662662
"""
663663
opmod = literals.operators
664664
excluded_types = set((opmod.CustomOperator, opmod.UFuncOperator))
665-
# check if opmod member should be wrapped as OperatorBuilder
666-
is_exported_type = lambda cls: (
667-
inspect.isclass(cls)
668-
and issubclass(cls, opmod.Operator)
669-
and not inspect.isabstract(cls)
670-
and cls not in excluded_types
671-
)
665+
666+
def is_exported_type(cls):
667+
"""Check if the class should be wrapped as OperatorBuilder."""
668+
return (
669+
inspect.isclass(cls) and
670+
issubclass(cls, opmod.Operator) and
671+
not inspect.isabstract(cls) and
672+
cls not in excluded_types
673+
)
674+
672675
# create OperatorBuilder objects
673676
for nm, opclass in inspect.getmembers(opmod, is_exported_type):
674677
op = opclass()

0 commit comments

Comments
 (0)