Python Forum
How to keep overview about methods in a module?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to keep overview about methods in a module?
#1
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
Reply
#2
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?
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
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!
Reply
#4
(Oct-05-2020, 07:28 AM)RedGreenBlue Wrote: What means refactoring, please?

Code Refactoring
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to find functions or methods in a module? deepakdeshp 8 4,173 May-23-2019, 09:36 AM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020