Python Forum
incremental testing in all()
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
incremental testing in all()
#1
i have a huge list that i want to test that everything is an expected type. i could test it like this:
    if all(isinstance(x,types) for x in huge_list):
        ... # what to do if all items are a type of one of "types"
    else:
        ... # what to do if one or more items are not a type of one of "types"
what i want to know is if all() quits early if one of its tests comes up False. documentation shows code that returns early. i want to know if "equivalent" really means that behavior or if it just means the result is "equivalent".
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
incremental testing in all() - by Skaperen - Aug-15-2019, 11:47 PM
RE: incremental testing in all() - by Skaperen - Aug-17-2019, 04:15 AM
RE: incremental testing in all() - by buran - Aug-17-2019, 06:01 AM
RE: incremental testing in all() - by Skaperen - Aug-18-2019, 07:10 PM
RE: incremental testing in all() - by perfringo - Aug-17-2019, 07:12 AM
RE: incremental testing in all() - by Gribouillis - Aug-17-2019, 07:36 AM
RE: incremental testing in all() - by buran - Aug-18-2019, 07:25 PM
RE: incremental testing in all() - by Skaperen - Aug-18-2019, 07:59 PM
RE: incremental testing in all() - by DeaD_EyE - Aug-18-2019, 11:36 PM
RE: incremental testing in all() - by Skaperen - Aug-19-2019, 06:18 AM

Forum Jump:

User Panel Messages

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