Python Forum

Full Version: How to keep overview about methods in a module?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Dear Python community,

thank you that I could join you.
I have wondered about a question and maybe you could help me with your experience.

So far, I have programmed in jupyter-lab and put all cells to a module together.
Now, all methods/functions are within a .py file and I lost overview what is actually inside, what functions exist. There also functions starting with underscore.
How do you keep the overview?
Are there editors that are able to detect what function definitions are inside the file and I could browse them?
How do you keep the overview, please?

Thank you for your help and suggestions.
Best regards,
RGB
dir(yourmodule)
you can use dir also on let say class, e.g. dir(yourclass)

if there is proper docstrings help(yourmodule) is also helpful

That said, if your module is so monospermous that you can not keep track of what's inside, maybe it's time to consider refactoring and better structure with multiple modules? Maybe even creating a package?
Thank you. I will try this out.
Are there more options and helpful tools in such a case?
What means refactoring, please?
Thank you, btw, for the quick reply!
(Oct-05-2020, 07:28 AM)RedGreenBlue Wrote: [ -> ]What means refactoring, please?

Code Refactoring