def flatsize(obj, align=0, **opts):
    '''Return the flat size of an object (in bytes), optionally aligned
    to a given power of 2.

    See function **basicsize** for a description of all other options.

    See this module documentation for the definition of *flat size*.
    '''
    v = _typedefof(obj, **opts)
    if v:
        if align > 1:
            m = align - 1
            if (align & m) != 0:
                raise ValueError('invalid option: %s=%r' % ('align', align))
        else:
            m = 0
        v = v.flat(obj, mask=m)
    return v
Return the flat size of an object (in bytes), optionally aligned
    to a given power of 2.

    See function **basicsize** for a description of all other options.

    See this module documentation for the definition of *flat size*.
    
recipes/Python/546530_Size_of_Python_objects_revised/recipe-546530.py