| 87 | return "A(%s)" % repr(self.expr) |
| 88 | |
| 89 | class B(ClauseElement): |
| 90 | __visit_name__ = "b" |
| 91 | |
| 92 | def __init__(self, *items): |
| 93 | self.items = items |
| 94 | |
| 95 | def is_other(self, other): |
| 96 | if other is not self: |
| 97 | return False |
| 98 | for i1, i2 in zip(self.items, other.items): |
| 99 | if i1 is not i2: |
| 100 | return False |
| 101 | return True |
| 102 | |
| 103 | __hash__ = ClauseElement.__hash__ |
| 104 | |
| 105 | def __eq__(self, other): |
| 106 | for i1, i2 in zip(self.items, other.items): |
| 107 | if i1 != i2: |
| 108 | return False |
| 109 | return True |
| 110 | |
| 111 | def __ne__(self, other): |
| 112 | for i1, i2 in zip(self.items, other.items): |
| 113 | if i1 != i2: |
| 114 | return True |
| 115 | return False |
| 116 | |
| 117 | def _copy_internals(self, clone=_clone, **kw): |
| 118 | self.items = [clone(i, **kw) for i in self.items] |
| 119 | |
| 120 | def get_children(self, **kwargs): |
| 121 | return self.items |
| 122 | |
| 123 | def __str__(self): |
| 124 | return "B(%s)" % repr([str(i) for i in self.items]) |
| 125 | |
| 126 | def test_test_classes(self): |
| 127 | a1 = A("expr1") |
no outgoing calls