Avoid x.__preserve__(), preferring preserve(x)
This commit is contained in:
parent
ed518a9c71
commit
f348701169
|
@ -297,7 +297,7 @@ def encode(p, v):
|
|||
if p.key == DICTOF:
|
||||
return dict((encode(p[0], k), encode(p[1], w)) for (k, w) in v.items())
|
||||
if p.key == REF:
|
||||
return v.__preserve__()
|
||||
return preserve(v)
|
||||
if p.key == REC:
|
||||
return Record(encode(p[0], v), encode(p[1], v))
|
||||
if p.key == TUPLE:
|
||||
|
@ -433,8 +433,8 @@ if __name__ == '__main__':
|
|||
with open(__metaschema_filename, 'rb') as f:
|
||||
x = Decoder(f.read()).next()
|
||||
print(meta.Schema.decode(x))
|
||||
print(meta.Schema.decode(x).__preserve__())
|
||||
assert meta.Schema.decode(x).__preserve__() == x
|
||||
print(preserve(meta.Schema.decode(x)))
|
||||
assert preserve(meta.Schema.decode(x)) == x
|
||||
|
||||
@extend(meta.Schema)
|
||||
def f(self, x):
|
||||
|
@ -450,7 +450,7 @@ if __name__ == '__main__':
|
|||
x = Decoder(f.read()).next()
|
||||
print(meta.Schema.decode(x))
|
||||
assert meta.Schema.decode(x) == meta.Schema.decode(x)
|
||||
assert meta.Schema.decode(x).__preserve__() == x
|
||||
assert preserve(meta.Schema.decode(x)) == x
|
||||
|
||||
print()
|
||||
print(path)
|
||||
|
|
|
@ -5,7 +5,7 @@ except ImportError:
|
|||
|
||||
setup(
|
||||
name="preserves",
|
||||
version="0.10.0",
|
||||
version="0.10.1",
|
||||
author="Tony Garnock-Jones",
|
||||
author_email="tonyg@leastfixedpoint.com",
|
||||
license="Apache Software License",
|
||||
|
|
Loading…
Reference in New Issue