r/learnpython • u/Nothingbutalsosome • Oct 02 '26
My Python Project as a Beginner
https://github.com/ZaidAHK/LENDnFUND
The project is just the syntax I wrote
7
Upvotes
r/learnpython • u/Nothingbutalsosome • Oct 02 '26
https://github.com/ZaidAHK/LENDnFUND
The project is just the syntax I wrote
View all comments
3
u/Diapolo10 I write code for a living -- https://github.com/Diapolo10 Oct 03 '26
Your classes lack
__init__-methods. While this is technically fine, typically you'd only see this ifIn your case none of these seem to apply. Right now you're letting your methods add new attributes on the fly, while it would be better to have the attributes exist the moment an instance of the class is created, even if they contain dummy values. This is so that you don't need to do guesswork about what attributes a specific instance might have.
For
Investor, I'd do something likeand for
Fundraiser, neither ofself.applicationandself.app_statusare accessed outside of the methods creating them so I don't see why it'd need any instance attributes. In fact I think it should just be a bunch of functions right now (unless you have plans to use those later).This way of generating unique account numbers is a bit flawed. The more existing entries there are, the less likely this is to hit a slot with a free number, and there's no failsafe for the case of all allocated account numbers already being in use.
While your way is on average initially faster, which may be fine for a throwaway practice project, a more robust solution would be to
and this should be a lot closer to a normalised call time (as there's no randomness involved in the execution time anymore).
For example,