Python Forum
should I ... go class or stick with functions?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
should I ... go class or stick with functions?
#3
IMHO, Project looks like good candidate for a class. Probably some of your functions may fit as class methods, some of them may be "internal" or static ones and some of they may be better as utility functions - i.e. outside class.
You should distinguish between between e.g. Project.number property (i.e. that will be the number assigned to that project and some utility function that will be run probably once per project (when you have new project) and will generate the number that you will assign to the project. But this is just what I imagine is your workflow.
Note, we really don't have enough information to advise you better.
Gribouillis likes this post
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


Messages In This Thread
RE: should I ... go class or stick with functions? - by buran - Nov-13-2020, 07:55 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Calling functions from within a class: PYQT6 Anon_Brown 4 3,946 Dec-09-2021, 12:40 PM
Last Post: deanhystad
  Why built in functions are defined as class? quazirfan 5 2,967 Oct-23-2021, 01:20 PM
Last Post: Gribouillis
  using class functions in roguelike game trousers1 3 2,657 Dec-02-2019, 08:22 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

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