Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9236181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:13:40+00:00 2026-06-18T07:13:40+00:00

Here is a mini version of problem a = [[1,2,3][0,0,0]] b = [[1,0,1][0,0,0]] c

  • 0

Here is a mini version of problem

a = [[1,2,3][0,0,0]]
b = [[1,0,1][0,0,0]]
c = [[0,0,0][1,0,1]]

so if level 1 is [] and level 2 is [[]], then what i’m trying to do is test ever list to see if there level 2’s match (regardless of order) so in this case b,c are equivalent.

i’m using unittesting and nosetests to run them
If i wanted to just test one table against another i would do something like:

the function truth() creates my tables

def test_table1_table2(self):
    for row in truth(1,3):
        self.assertIn(row,truth(2,4))

but My goal is to test all tables against all other tables i have created (about 20 and growing). Some issues i can’t work out (i’m not sure if i need to read unittest docs or nosetests or don’t even need them!)

my guess is to just use more for loops to pull out ever possibility. But using

>>> nosetest 

with a

assertIn 

just stops at the first error, which isn’t what i want. i need to scan and collect info on which lists are equivalent at (regardless of order or the nested lists). maybe i should just create something and forget about unittests?

so my preferred output would be something like

table1 and table2 are not equivalent 
table1 and table2 are not equivalent

or probable more useful and shorter would just be

table1 and table10 are equivalent

Here is the code i have currently, almost everything is just a integer there expect truth() which makes the truth table (nested list):

114     def test_all(self):$                                                  |~                      
115         ''' will test all tables'''$                                      |~                      
116         for expression in range(self.count_expressions()):$               |~                      
117             num_var = count_vars(exp_choose(expression))$                 |~                      
118             for row in truth(expression, num_var):$                       |~                      
119                 for expression2 in range(self.count_expressions()):$      |~                      
120                     num_var2 = count_vars(exp_choose(expression2))$       |~                      
121                     for row2 in truth(expression2, num_var2):$            |~                      
122                         self.assertIn(row, truth(expression2,num_var2))
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T07:13:41+00:00Added an answer on June 18, 2026 at 7:13 am

    A simpler approach would be to use unittest’s assertItemsEqual, which is designed for exactly this purpose. Given O.P.’s a, b, & c nested lists:

    class CheckingEqualityIgnoreOrder(unittest.TestCase):
        def testAB(self):
            self.assertItemsEqual(a, b)
            #fails
    
        def testBC(self):
            self.assertItemsEqual(b, c)
            #passes
    
        def testAC(self):
            self.assertItemsEqual(a, c)
            #fails
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a mini browser inside a window using extJS. Here's what
im having a problem on my mini project. i have a method here def
I coded, global mini form validation for jquery. This here; This code, All form
Here is the code in a function I'm trying to revise. This example works
I have an application with a WebView, where there's a long list of posts
I'm trying to update products using the Shopify API. Here's a sample XML request
I'm trying to use an Entry field to get manual input, and then work
I'm pretty new to Perl/HTML. Here is what I'm trying to do with WWW::Mechanize
here is what I'm trying to solve. I have a crash dump from Google
I'm using Fluent NHibernate (1.2.0.712) and Nhibernate.Linq (version 1) with SQLite (1.0.79) Here is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.