Skip to content

Refactor: Improve clarity and readability of loader function #64

Description

@Nate1729

Description here

There are some readability improvements that could be made to the loader() function in core/loader:loader. For example checking if some_string == '' is redundant. An empty string is cast to False in python (L27).

On L29 rather than use a break a continue would be more appropriate since you want to go to the next iteration rather than stop the iteration entirely.

L37 serves no purpose to be inside the main for-loop. It could be defined even before the with-block.

L39 could be replaced with a call to the filter() function which removes the need to copy the data into a new list.

branch suggestion: refactor/loader:loader
commit suggestion: refactor: #64 - refactor loader fn
we like to see conventional commits

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions