Equal#

class Equal(obj, obj2, *args, method=None, detailed=False, equal_nan=True, leaf=False, union=True, verbose=None, compare=True, die=False, **kwargs)[source]#

Bases: prettyobj

Attributes

base

Get the base object

bdict

Get the base dictionary

n

Find out how many objects are being compared

odicts

Get the other dictionaries

others

Get the other objects

special_cases

valid_methods

Methods

property n#

Find out how many objects are being compared

property base#

Get the base object

property others#

Get the other objects

property bdict#

Get the base dictionary

property odicts#

Get the other dictionaries

check_method()[source]#

Check that a valid method is supplied

get_method(method=None)[source]#

Use the method if supplied, else use the default one

walk()[source]#

Use sc.iterobj() to convert the objects into dictionaries

make_tree()[source]#

Determine the keys to iterate over

convert(obj, method=None)[source]#

Convert an object to the right type prior to comparing

compare_special(obj, obj2)[source]#

Do special comparisons for known objects where == doesn’t work

static keytostr(k, ind='', sep='.')[source]#

Helper method to convert a key to a “trace” for printing

compare()[source]#

Perform the comparison

check_exceptions()[source]#

Check if any exceptions were encountered during comparison

to_df()[source]#

Convert the detailed results dictionary to a dataframe