Python Forum
How to check if class instance exists in a list of class instance objects?
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to check if class instance exists in a list of class instance objects?
#11
(May-25-2018, 06:39 PM)buran Wrote: If need to keep order buran dictionary(3.6+) will do that.
not sure if that's at me, but what I wanted to say is that given list [person1, person2, person3] if we use dict, at the end we will have
[person3, person2] (in that order in python 3.6, and [possibly] reversed in python2 and python3 before 3.6), i.e. person3 would replace person1 as value for key 'John'.
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
RE: How to check if class instance exists in a list of class instance objects? - by buran - May-25-2018, 06:45 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [SOLVED] [listbox] Feed it with dict passed to class? Winfried 3 179 Yesterday, 05:57 AM
Last Post: Larz60+
  Class and methods Saida2024 2 174 Yesterday, 04:04 AM
Last Post: deanhystad
  [split] Class and methods ebn852_pan 2 164 May-12-2024, 08:07 AM
Last Post: Gribouillis
  How does this code create a class? Pedroski55 6 588 Apr-21-2024, 06:15 AM
Last Post: Gribouillis
  class definition and problem with a method HerrAyas 2 317 Apr-01-2024, 03:34 PM
Last Post: HerrAyas
  Printing out incidence values for Class Object SquderDragon 3 356 Apr-01-2024, 07:52 AM
Last Post: SquderDragon
  class and runtime akbarza 4 449 Mar-16-2024, 01:32 PM
Last Post: deanhystad
  Help with to check an Input list data with a data read from an external source sacharyya 3 494 Mar-09-2024, 12:33 PM
Last Post: Pedroski55
  Operation result class SirDonkey 6 621 Feb-25-2024, 10:53 AM
Last Post: Gribouillis
  The function of double underscore back and front in a class function name? Pedroski55 9 795 Feb-19-2024, 03:51 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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