Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

rethink sets.List() / sets.Set.UnsortedList() naming? #117673

Copy link
Copy link
Open
@danwinship

Description

@danwinship
Issue body actions

Having played around with the new generics-based sets API a bit, I really dislike sets.List().

The List/UnsortedList API always seemed a little bit weird to me, in that the "default" behavior (List) was to sort the output, and you had to explicitly specify if you didn't want that... Now with the generic version, the naming/behavior is even weirder... UnsortedList is now distinguishing itself from another method that doesn't actually exist, while List is now a helper function whose name doesn't really indicate how it helps. The names basically only make sense in the context of comparing them to the old API (which will presumably eventually go away).

So maybe:

  • rename x.UnsortedList() to x.Elements()
  • rename sets.List(x) to sets.Sort(x) or sets.SortElements(x) or sets.SortedElements(x)
    ?

cc @weilaaa @lavalamp @pohly

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.Indicates an issue or PR lacks a `triage/foo` label and requires one.sig/api-machineryCategorizes an issue or PR as relevant to SIG API Machinery.Categorizes an issue or PR as relevant to SIG API Machinery.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.