This module provides support to compare two lists that have same or different types of data in it.
Project description
This module provides support to compare two lists that have same or different types of data in it.
Examples
lis1 = [1, 2 ,3]
lis2 = [2, 1]
plc.compare_list(lis1, dlis2) # Frue
lis1 = [1, 2, 3]
lis2 = [2, 1, '3']
plc.compare_list(lis1, lis2) # False
lis1 = ['1', '2', '3']
lis2 = ['2', '1']
plc.compare_list(lis1, lis2) # False
lis1 = [1, 2, 3]
lis2 = [2, 1, 3]
plc.compare_list(lis1, lis2) # True
lis1 = [{1: 1, 2: 2}]
lis2 = [{1: 1, 2: 2}]
plc.compare_list(lis1, lis2) # True
lis1 = 123
lis2 = [{1: 1, 2: 2}]
plc.compare_list(lis1, lis2) # Exception will be raised
lis1 = [1, 'a', {1: 1, 2: 2}, 3]
lis2 = [3, 1, {1: 1, 2: 2}, 'a']]
plc.compare_list(lis1, lis2) # True
Examples
lis1 = [1, 2 ,3]
lis2 = [2, 1]
plc.compare_list(lis1, dlis2) # Frue
lis1 = [1, 2, 3]
lis2 = [2, 1, '3']
plc.compare_list(lis1, lis2) # False
lis1 = ['1', '2', '3']
lis2 = ['2', '1']
plc.compare_list(lis1, lis2) # False
lis1 = [1, 2, 3]
lis2 = [2, 1, 3]
plc.compare_list(lis1, lis2) # True
lis1 = [{1: 1, 2: 2}]
lis2 = [{1: 1, 2: 2}]
plc.compare_list(lis1, lis2) # True
lis1 = 123
lis2 = [{1: 1, 2: 2}]
plc.compare_list(lis1, lis2) # Exception will be raised
lis1 = [1, 'a', {1: 1, 2: 2}, 3]
lis2 = [3, 1, {1: 1, 2: 2}, 'a']]
plc.compare_list(lis1, lis2) # True
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
listcompare-2.1.0.tar.gz
(15.3 kB
view hashes)