Ticket #5: testrecuset.py

File testrecuset.py, 551 bytes (added by Peter Murphy (pkmurphy at postmaster dot co dot uk), 8 years ago)

A test file for recursive sets

Line 
1# This is the testrecuset module. It contains code that tests the output and input of
2# YAML with recursive sets. We also look at tuples.
3
4import yaml;
5
6
7class C: 
8    pass;
9
10c = C()
11c.t = c;
12s = set([c])
13c.s = s
14
15print "We print the object s"
16print s;
17D = yaml.dump(s);
18print D;
19E = yaml.load(D);
20print E;
21
22
23print "We print the class instance c."
24print c;
25D = yaml.dump(c);
26print D;
27E = yaml.load(D); #Not constructing c again??
28print E;
29
30
31#print "CCC"
32
33#Q = "--- &A !!set { *A }"
34#R = yaml.load(Q);
35#print R;
36
37