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

fix: avoid duplicate pages information #265

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sellisd
Copy link

@sellisd sellisd commented Jan 20, 2025

this should fix issue #264

Use set and then convert back to list in order
to avoid duplicate page message
tldr.py Outdated
@@ -205,7 +205,7 @@ def get_platform() -> str:


def get_platform_list() -> List[str]:
platforms = ['common'] + list(OS_DIRECTORIES.values())
platforms = ['common'] + list(set(list(OS_DIRECTORIES.values())))
Copy link
Member

@sebastiaanspeck sebastiaanspeck Jan 21, 2025

Choose a reason for hiding this comment

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

Suggested change
platforms = ['common'] + list(set(list(OS_DIRECTORIES.values())))
platforms = ['common'] + list(set(OS_DIRECTORIES.values()))

Have you tried like this?

Copy link
Author

Choose a reason for hiding this comment

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

Have you tried like this?

It doesn't work because we can't concatenate set and list with the plus operator (+), so we need to cast it back to a list. We can however skip the inner conversion:

['common']+list(set(OS_DIRECTORIES.values()))

so we go from dict_values to set to list, and we gain one step 8)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants