Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tldr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Contributor 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)

current_platform = get_platform()
platforms.remove(current_platform)
platforms.insert(0, current_platform)
Expand Down
Loading