Skip to content

Refactor: drop redundant list() wrapper around sorted() in formatter.py/text.py #10568

Description

@Adityaj0

Summary

`awscli/formatter.py:209-210` (`TableFormatter._group_scalar_keys_from_list`) and `awscli/text.py:91` (`_all_scalar_keys`) wrap `sorted(...)` in `list(...)`, e.g. `headers = list(sorted(headers))`. `sorted()` already returns a `list`, so the wrapper is a needless no-op call.

Proposed change

Drop the redundant `list()` wrapper in both locations: `headers = sorted(headers)`, `more = sorted(more)`, `return sorted(keys_seen)`. Pure refactor, no behavior change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageThis issue or PR still needs to be triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions