Python Forum
How are these Employee objects stored?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How are these Employee objects stored?
#1
I have a very simple program to create Employee objects:

class Employee:

  def __init__(self, id, salary):
    self.id = id
    self.salary = salary
Now lets say I built a method that would create new employee objects: emp1, emp2, emp3 ... empN. I can access these objects attributes like: emp1.id or emp5.salary. My question is, where and how are these objects being stored? Is there some list that is created or some stack that is created in memory such that when I call emp1.id it pops that objects id off the stack or something?

The reason I ask is because I am making a GUI. My GUI allows users to create new Employees and display there information but only one at a time. So I thought I would build a method that stores each newly created Employee object. However, that got me to thinking... how are they normally being stored>> do I even need to create a new list to store them or does one already exist?
Reply


Messages In This Thread
How are these Employee objects stored? - by Vysero - Jul-12-2018, 04:16 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Deleting employee from list SephMon 3 3,312 Jan-05-2021, 04:15 AM
Last Post: deanhystad
  plot multiple employee sales data in a single graph pitanshu 0 1,929 Oct-24-2019, 01:56 PM
Last Post: pitanshu

Forum Jump:

User Panel Messages

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