Python Forum
Creating a list of class objects
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Creating a list of class objects
#3
(Jul-22-2017, 01:41 PM)ichabod801 Wrote: If I make a dummy class that just stores one instance attribute when getData is called, it works fine. I would expect the problem is in your classObject definition. Could be assigning to a class attribute by mistake?

The problem was in getData function. I used 3 lists in it, and I filled each of them using list.append(sth). No idea why, but when I declared these lists again in the function itself, everything started working perfectly.

Thanks a lot for answering!
Reply


Messages In This Thread
Creating a list of class objects - by hjuyrfc - Jul-22-2017, 01:23 PM
RE: Creating a list of class objects - by hjuyrfc - Jul-22-2017, 07:41 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to read module/class from list of strings? popular_dog 1 486 Oct-04-2023, 03:08 PM
Last Post: deanhystad
  How can I access objects or widgets from one class in another class? Konstantin23 3 1,023 Aug-05-2023, 08:13 PM
Last Post: Konstantin23
  Creating list of lists, with objects from lists sgrinderud 7 1,678 Oct-01-2022, 07:15 PM
Last Post: Skaperen
Question Keyword to build list from list of objects? pfdjhfuys 3 1,580 Aug-06-2022, 11:39 PM
Last Post: Pedroski55
  How to store the resulting Doc objects into a list named A xinyulon 1 1,909 Mar-08-2022, 11:49 PM
Last Post: bowlofred
  Grouping and sum of a list of objects Otbredbaron 1 3,231 Oct-23-2021, 01:42 PM
Last Post: Gribouillis
  Class-Aggregation and creating a list/dictionary IoannisDem 1 1,935 Oct-03-2021, 05:16 PM
Last Post: Yoriz
  apendng to a list within a class gr3yali3n 4 2,374 Feb-16-2021, 06:30 AM
Last Post: buran
  How to append multiple <class 'str'> into a single List ahmedwaqas92 2 2,357 Jan-07-2021, 08:17 AM
Last Post: ahmedwaqas92
  Creating list of lists from generator object t4keheart 1 2,222 Nov-13-2020, 04:59 AM
Last Post: perfringo

Forum Jump:

User Panel Messages

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