Python Forum
Unchangeable variables in a class?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unchangeable variables in a class?
#6
Version 3.10 on ubuntu with vscode editor
I've been doing a little reading on this, from what I understand that there is no way to prevent either class or instance variables from being changed.
The closest thing I found was some thing about using __slots__
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags
Download my project scripts


Reply


Messages In This Thread
Unchangeable variables in a class? - by Calab - Sep-15-2023, 02:27 PM
RE: Unchangeable variables in a class? - by Calab - Sep-15-2023, 02:55 PM
RE: Unchangeable variables in a class? - by Calab - Sep-15-2023, 03:48 PM
RE: Unchangeable variables in a class? - by menator01 - Sep-15-2023, 03:47 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Class variables and Multiprocessing(or concurrent.futures.ProcessPoolExecutor) Tomli 5 6,591 Nov-12-2021, 09:55 PM
Last Post: snippsat
  How to pass variables from one class to another hobbyist 18 20,298 Oct-01-2021, 05:54 PM
Last Post: deanhystad
  Acess variables from class samuelbachorik 3 2,663 Aug-20-2021, 02:55 PM
Last Post: deanhystad
  Class variables menator01 2 2,807 Jun-04-2020, 04:23 PM
Last Post: Yoriz
  Question about naming variables in class methods sShadowSerpent 1 2,711 Mar-25-2020, 04:51 PM
Last Post: ndc85430
  Understanding Class Variables vindo 9 5,672 Jun-05-2019, 08:04 PM
Last Post: Yoriz
  What is the strategy for working with class variables? AlekseyPython 3 3,772 Feb-24-2019, 05:34 AM
Last Post: AlekseyPython
  Base class variables are not accessible Prabakaran141 3 3,762 Oct-31-2018, 07:13 AM
Last Post: buran
  Class Modules, and Passing Variables: Seeking Advice Robo_Pi 21 14,032 Mar-02-2018, 05:22 PM
Last Post: snippsat
  Running Class methods in a loop and updating variables. ujjwalrathod007 3 7,982 Oct-05-2016, 07:11 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

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