new92 / InstaTools

🧰 A collection of tools used for automating tasks on Instagram 📱| Written in Python 🐍 | Don't forget to ⭐ the repo !
https://github.com/new92/InstaTools
MIT License
115 stars 23 forks source link

optimized Tracker.py #10

Closed ghost closed 11 months ago

ghost commented 11 months ago

Made the following changes:

-> switched unchanged list 'mods' to tuple as it saves both runtime & memory. -> removed unnecessary !=0 and boolean references in conditional statements. -> removed unnecessary short if-else statements in variable declarations. -> optimized while loop conditionals & made them more readable. -> removed str conversion with input call as the input received is always a string. -> replaced '== None' by 'is None'.

ghost commented 11 months ago

According to python pep8 formatting convention:

-> function imports must be avoided, rather modules as a whole should be imports. It allows the readers to know the origination of the function and also helps in reducing the chances of function overriding.

It's my recommendation to bring that in action.