Add using-constant-test
, use-list-literal
& useless-object-inheritance
check
#100
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
use-list-literal
check ensures usinglist literals (i.e., [])
instead of thelist()
function.The
using-constant-test
check indicates that if the conditional statement always evaluates to the same value and is therefore unnecessary. In this case, its better to remove the unnecessary conditional statement.The
use-a-generator
check suggests to use a generator expression instead of a list comprehension inside the function. Using a generator expression instead of a list comprehension can be more efficient because it does not create a new list in memory. Instead, it generates values on the fly as they are needed, which can save memory and improve the performanceof our code.The
unused-variable
check ensures that there is no unsed variable declared in the code.The
useless-object-inheritance
check ensures that inPython 3,
it is no longer necessary to explicitly inherit from object since all classes inherit from object by default. Therefore, we can safely remove the reference to object from the class definition. This will ensure that the class still inherits from object by default in Python 3.Related to #85