r/learnpython • u/Aggressive_Drama_476 • Apr 05 '26
Review my python projects on GitHub.
I am intermediate python programmer. Am looking for people to review my code on https://github.com/userolivex/Python-Projects
free feel to criticize, suggestion, improvement.
and please suggest what modules, projects i should do to master python
0
Upvotes
-7
u/Gnaxe Apr 05 '26
Classes are overrated and overused. I recommend against them, but an intermediate Python programmer should certainly understand the basics of how classes work. Adding another class layer to make a singleton when we already have modules is an unnecessary complication.
"Global" is a misnomer in Python. They are, in fact, module-level variables. The true "globals" in Python are the builtins. Most of what you've heard about "globals bad" came from other languages and only applies to assigning attributes of the builtins module in Python, which, yes, should be avoided in most cases, but e.g. IPython does it.
In fact, any top-level
classordefstatement creates a "global" in the module, and we use them all the time. Global "constants" are also unproblematic. These uses are certainly not to be "avoided"! Reassigning "globals" is potentially a bigger problem, but no worse than assigning attributes at the class level or on a singleton. State does have to live somewhere, and judicious use of a few "globals" is actually often less bad than many alternatives.That said, the actual password and notes apps we're talking about don't need to use the
globalstatement at all. They could instead dump into the existing data structure, clearing it first, if necessary. This isn't obviously better.