Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Class question
#7
@Calli:
OP question was ansered already.
What you suggest - using getters/setters for properties is anti-pattern in python. Even in your code you don't use them in __str__() method :-)
some reading: Why don't you want getters and setters?
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
Class question - by robdineen - May-28-2020, 09:16 PM
RE: Class question - by menator01 - May-28-2020, 09:26 PM
RE: Class question - by bowlofred - May-28-2020, 09:27 PM
RE: Class question - by robdineen - May-29-2020, 08:10 PM
RE: Class question - by pyzyx3qwerty - May-29-2020, 05:13 AM
RE: Class question - by Calli - May-30-2020, 05:36 AM
RE: Class question - by buran - May-30-2020, 05:42 AM
RE: Class question - by Calli - May-30-2020, 05:44 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  question about __repr__ in a class akbarza 4 612 Jan-12-2024, 11:22 AM
Last Post: DeaD_EyE
  Initiating an attribute in a class __init__: question billykid999 8 1,315 May-02-2023, 09:09 PM
Last Post: billykid999
  [Solved] Novice question to OOP: can a method of class A access attributes of class B BigMan 1 1,313 Mar-14-2022, 11:21 PM
Last Post: deanhystad
  newbie question....importing a created class ridgerunnersjw 5 2,642 Oct-01-2020, 07:59 PM
Last Post: ridgerunnersjw
  Question about naming variables in class methods sShadowSerpent 1 2,007 Mar-25-2020, 04:51 PM
Last Post: ndc85430
  class question jrauden 1 1,557 Feb-16-2020, 10:14 AM
Last Post: ibreeden
  Class Question esteel 5 4,074 May-22-2018, 10:27 AM
Last Post: esteel
  First Post/ Class Error Question jvan1601 2 3,418 May-01-2017, 04:21 AM
Last Post: jvan1601

Forum Jump:

User Panel Messages

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