Python Forum
what's homogeneus items defined by list
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
what's homogeneus items defined by list
#4
frank0903 Wrote:how to define homougeneous collections? I mean how to express it more exactly
There is no general definition. Often it means that the objects are all instances of the same class. It really depends on what you want to do with the objects. For example if you want to be able to add an integer to each object, then it could be a definition of homogeneous collection: "a list of objects to which one can add an integer".

There is no side effect whatsoever, the list class doesn't care about the kind of objects that it contains. The only effect is that the code that uses this list will be simpler if it doesn't have to worry about the type of the objects.
Reply


Messages In This Thread
RE: what's homogeneus items defined by list - by Gribouillis - Jun-25-2020, 10:53 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  variable not defined inside a list comprehension Phidias618 1 2,072 May-13-2023, 09:05 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

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