Skip to content

Implement perflint #4789

Description

@93578237

https://github.com/tonybaloney/perflint - Python Linter for performance anti patterns.

  • PERF101: Unnecessary list() on already iterable type (unnecessary-list-cast)
  • PERF102: Incorrect iterator method for dictionary (incorrect-dictionary-iterator)
  • PERF201: Loop invariant statement (loop-invariant-statement)
  • PERF202: Global name usage in a loop (loop-global-usage)
  • PERF203: Try..except blocks have a significant overhead. Avoid using them inside a loop (loop-try-except-usage)
  • PERF204: Looped slicing of bytes objects is inefficient. Use a memoryview() instead (memoryview-over-bytes)
  • PERF205: Importing the "%s" name directly is more efficient in this loop. (dotted-import-in-loop)
  • PERF301: Use tuple instead of list for a non-mutated sequence. (use-tuple-over-list)
  • PERF401: Use a list comprehension instead of a for-loop (use-list-comprehension)
  • PERF402: Use a list copy instead of a for-loop (use-list-copy)
  • PERF403: Use a dictionary comprehension instead of a for-loop (use-dict-comprehension)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedReady for implementationpluginImplementing a known but unsupported Ruff plugin

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions