hpc / charliecloud

Now hosted on GitLab.
https://gitlab.com/charliecloud/main
Apache License 2.0
313 stars 61 forks source link

tidy: enforce `list()` and `dict()` #1876

Open reidpr opened 6 months ago

reidpr commented 6 months ago

Split from #1860. Pylint:

https://github.com/hpc/charliecloud/blob/d67937332094a7d8de8e9bd2e112d30d117c50c0/lib/build.py#L334

Pylint’s sole argument seems to be performance, which to me seems a clear case of premature optimization. The issue that introduced the checks, pylint-dev/pylint#4365, contains no reasoning at all, just the assertion that the literals would be “would be clearer”.

I like list() and dict() and set() and tuple() better myself for empty collections. Let’s enforce that instead.