Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: PackageManifest utilities for working with Compilers list [APE-1497] #94

Merged
merged 12 commits into from
Nov 4, 2023
9 changes: 3 additions & 6 deletions ethpm_types/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,6 @@ def add_compilers(self, *compilers: Compiler):
compilers.
"""

full_list: List[Compiler] = self.compilers or []
for compiler in compilers:
if compiler not in full_list:
full_list.append(compiler)

self.compilers = full_list
start = self.compilers or []
start.extend([c for c in compilers if c not in start])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the future I think .extend takes in a sequence so you can just do .extend(c for c in ...)

self.compilers = start