'Return the numerical value of the highest priority present throughout
all settings, or the numerical value for ``default`` from
:attr:`~scrapy.settings.SETTINGS_PRIORITIES` if there are no settings
stored.'

def maxpriority(self):

    if (len(self) > 0):
        return max((self.getpriority(name) for name in self))
    else:
        return get_settings_priority('default')
