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?
#1
Hi guys,

I have a bunch of functions which are 'bundled' in a __init__.py

The functions are basicly way to get standard data from our office.
Think of:
- what is the projectnumber
-----> no input needed. A program api query returns a value which is altered and returned.
- where to store pdf files based upon the age of a project
-----> projectnubmer as input for the function, based upon its value, a specific spot is returned.
- etc.etc.

Now, since I'm learning python myself, I'm looking at classes quite often and was wondering if the above is suited for a class?

I -think- I know what a class does, but hey, advice is much appreciated!


So I think:
MyProject.projectnumber()
MyProject.pdflocation()
MyProject.etcetc
would make more sense?
Reply


Messages In This Thread
should I ... go class or stick with functions? - by 3Pinter - Nov-13-2020, 07:26 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Calling functions from within a class: PYQT6 Anon_Brown 4 3,846 Dec-09-2021, 12:40 PM
Last Post: deanhystad
  Why built in functions are defined as class? quazirfan 5 2,904 Oct-23-2021, 01:20 PM
Last Post: Gribouillis
  using class functions in roguelike game trousers1 3 2,609 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