def gpx_check_slots_and_default_values(classs):
    """
    Will fill the default values for this class. Instances will inherit those
    values so we don't need to fill default values for every instance.

    This method will also fill the attribute gpx_field_names with a list of
    gpx field names. This can be used
    """
    fields = classs.gpx_10_fields + classs.gpx_11_fields

    gpx_field_names = []

    instance = classs()

    try:
        attributes = list(filter(lambda x : x[0] != '_', dir(instance)))
        attributes = list(filter(lambda x : not callable(getattr(instance, x)), attributes))
        attributes = list(filter(lambda x : not x.startswith('gpx_'), attributes))
    except Exception as e:
        raise Exception('Error reading attributes for %s: %s' % (classs.__name__, e))

    attributes.sort()
    slots = list(classs.__slots__)
    slots.sort()

    if attributes != slots:
        raise Exception('Attributes for %s is\n%s but should be\n%s' % (classs.__name__, attributes, slots))

    for field in fields:
        if not isinstance(field, str):
            if field.is_list:
                value = []
            else:
                value = None
            try:
                actual_value = getattr(instance, field.name)
            except:
                raise Exception('%s has no attribute %s' % (classs.__name__, field.name))
            if value != actual_value:
                raise Exception('Invalid default value %s.%s is %s but should be %s'
                                % (classs.__name__, field.name, actual_value, value))
            #print('%s.%s -> %s' % (classs, field.name, value))
            if not field.name in gpx_field_names:
                gpx_field_names.append(field.name)

    gpx_field_names = tuple(gpx_field_names)
    if not hasattr(classs, '__slots__') or not classs.__slots__ or classs.__slots__ != gpx_field_names:
        try: slots = classs.__slots__
        except Exception as e: slots = e % '[Unknown:%s]'
        raise Exception('%s __slots__ invalid, found %s, but should be %s' % (classs, slots, gpx_field_names))
dataset/ETHPy150Open tkrajina/gpxpy/gpxpy/gpxfield.py/gpx_check_slots_and_default_values/swapped operands of `%`