def setup(self):

        class Double(Compound):

            field_schema = [Integer.named(u'x'), Integer.named(u'y')]

            def compose(self):
                ex, ey = self.get(u'x'), self.get(u'y')
                ux, uy = ex.u, ey.u
                if ex.u and ey.u:
                    string = u"%sx%s" % (ex.u, ey.u)
                else:
                    string = u''

                if ex.value is not None and ey.value is not None:
                    value = (ex.value, ey.value)
                else:
                    value = None

                return string, value

            def explode(self, value):
                if value == u'boom':
                    raise AttributeError('boom')
                if value == u'return-none':
                    return
                try:
                    x, y = value
                except (__HOLE__, ValueError):
                    return False
                self[u'x'].set(x)
                self[u'y'].set(y)
                return True

        self.Double = Double
dataset/ETHPy150Open jek/flatland/tests/schema/test_compound.py/TestDoubleField.setup