Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Clean up/optimize code #443

Open
rmusser01 opened this issue Nov 23, 2024 · 1 comment
Open

Enhancement: Clean up/optimize code #443

rmusser01 opened this issue Nov 23, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@rmusser01
Copy link
Owner

Title.
Clean things up before releasing v1.0.

@rmusser01 rmusser01 added the enhancement New feature or request label Nov 23, 2024
@rmusser01 rmusser01 added this to the v1.0 Release milestone Nov 23, 2024
@rmusser01 rmusser01 self-assigned this Nov 23, 2024
@rmusser01
Copy link
Owner Author

Generators - use for large data sets
    Instead of: `data = [process(item) for item in big_list]`
    Use: ```
        def data_generator(big_list):
            for item in big_list:
                yield process(item)
        ```
        ```
        for item in data_generator(big_list):
            # Do something with item
        ```
If you’re creating a list just to loop over it once, consider using a generator instead.
Profiling
    https://www.turing.com/kb/python-code-with-cprofile
Sets/Dicts over lists
    ```
    if item in my_list:
        # Do something
    ```
    Do:
    ```        
    my_set = set(my_list)
    if item in my_set:
        # Do something
    ```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant