MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / __repr__

Method __repr__

lib/sqlalchemy/testing/entities.py:24–40  ·  lib/sqlalchemy/testing/entities.py::BasicEntity.__repr__
(self)

Source from the content-addressed store, hash-verified

22 setattr(self, key, value)
23
24 def __repr__(self):
25 if id(self) in _repr_stack:
26 return object.__repr__(self)
27 _repr_stack.add(id(self))
28 try:
29 return class="st">"%s(%s)" % (
30 (self.__class__.__name__),
31 class="st">", ".join(
32 [
33 class="st">"%s=%r" % (key, getattr(self, key))
34 for key in sorted(self.__dict__.keys())
35 if not key.startswith(class="st">"_")
36 ]
37 ),
38 )
39 finally:
40 _repr_stack.remove(id(self))
41
42
43_recursion_stack = set()

Callers

nothing calls this directly

Calls 5

addMethod · 0.45
joinMethod · 0.45
keysMethod · 0.45
startswithMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected