Skip to content

Commit

Permalink
Simplify related python code
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell committed Sep 18, 2024
1 parent 7593bd6 commit 103b1ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/podio/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

def _get_cpp_types(type_str):
"""Get all possible c++ types from the passed py_type string."""
types = list(filter(lambda t: type_str in t, SUPPORTED_PARAMETER_TYPES))
types = [t for t in SUPPORTED_PARAMETER_TYPES if type_str in t]
if not types:
raise ValueError(f"{type_str} cannot be mapped to a valid parameter type")

Expand All @@ -43,7 +43,7 @@ def _get_cpp_vector_types(type_str):
"""Get the possible std::vector<cpp_type> from the passed py_type string."""
# Gather a list of all types that match the type_str (c++ or python)
types = _get_cpp_types(type_str)
return [f"std::vector<{t}>" for t in map(lambda x: x[0], types)]
return [f"std::vector<{t[0]}>" for t in types]


def _is_collection_base(thing):
Expand Down

0 comments on commit 103b1ac

Please sign in to comment.