Python Forum
Class Modules, and Passing Variables: Seeking Advice
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Class Modules, and Passing Variables: Seeking Advice
#7
I agree with Larz. It's more correct/intuitive to have a class Alysha with multiple methods. Think of class as objects. Reading is "activity", i.e. it's intuitive to have it as method of an object (class), different properties of an object (like color or list of commands), well have them as property of the class. In certain cases it may be convenient for you to have an abstract object like Reader, but this is not the case here.

Also, I strongly advise you to read PEP 8 and follow it, because your current code does not comply with it and is hard to follow and will be difficult for other people to contribute in the future if it becomes large project.
Reply


Messages In This Thread
RE: Class Modules, and Passing Variables: Seeking Advice - by buran - Mar-01-2018, 08:45 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Seeking advice on dask distributed sawtooth500 4 498 Apr-15-2024, 11:07 PM
Last Post: sawtooth500
  Unchangeable variables in a class? Calab 12 1,873 Sep-15-2023, 07:15 PM
Last Post: deanhystad
  Class variables and Multiprocessing(or concurrent.futures.ProcessPoolExecutor) Tomli 5 4,112 Nov-12-2021, 09:55 PM
Last Post: snippsat
  How to pass variables from one class to another hobbyist 18 11,490 Oct-01-2021, 05:54 PM
Last Post: deanhystad
  Acess variables from class samuelbachorik 3 1,980 Aug-20-2021, 02:55 PM
Last Post: deanhystad
  Passing Variables between files. victorTJ 3 2,370 Oct-17-2020, 01:45 AM
Last Post: snippsat
  New user seeking help EdRaponi 2 56,416 Jun-23-2020, 12:03 PM
Last Post: EdRaponi
  Class variables menator01 2 2,100 Jun-04-2020, 04:23 PM
Last Post: Yoriz
  Question about naming variables in class methods sShadowSerpent 1 2,100 Mar-25-2020, 04:51 PM
Last Post: ndc85430
  Python 2.7 passing variables from functions zetto33 1 1,859 Mar-19-2020, 07:27 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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