class MyIntegerTenClass:

    def __int__(self):
        return 10

def __str__(self):
    return 'ten'

def __format__(self, format_spec):
    pass
String formatting with “{0:d}” doesn't convert to integer