You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
```
Title.
Clean things up before releasing v1.0.
The text was updated successfully, but these errors were encountered: