MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / AB

Class AB

test/orm/test_composites.py:790–812  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

788
789 def _fixture(self):
790 class AB:
791 def __init__(self, a, b, cd):
792 self.a = a
793 self.b = b
794 self.cd = cd
795
796 @classmethod
797 def generate(cls, a, b, c, d):
798 return AB(a, b, CD(c, d))
799
800 def __composite_values__(self):
801 return (self.a, self.b) + self.cd.__composite_values__()
802
803 def __eq__(self, other):
804 return (
805 isinstance(other, AB)
806 and self.a == other.a
807 and self.b == other.b
808 and self.cd == other.cd
809 )
810
811 def __ne__(self, other):
812 return not self.__eq__(other)
813
814 class CD:
815 def __init__(self, c, d):

Callers 2

generateMethod · 0.70
test_round_tripMethod · 0.70

Calls

no outgoing calls

Tested by 2

generateMethod · 0.56
test_round_tripMethod · 0.56