I'd rather utilize a metaclass in this special case. This would retain the notion of Foo being a type much better than transmogrifying a function into a class. (Granted, there's not that big a difference technically but you're tricking other programmers into believing Foo cannot be used for eg. isinstance.)
class Foo(Struct):
__endian__ = Struct.LE
foo = Struct.uint32
bar = Struct.string(foo)
If you don't like specifying the endianness as a class attribute you could still inherit from Struct.LE/BE rather than Struct itself.Quick technical howto: make Struct have a __metaclass__ class attribute, populate the __metaclass__ class with a __new__ or __init__ method performing the desired transformations.
See http://www.python.org/download/releases/2.2/descrintro/#meta... for details on metaclasses.