@@ -59,9 +59,6 @@ def query(self) -> typing.Optional[str]:
5959 return self ._query
6060
6161 def __repr__ (self ) -> str :
62- assert type (self ) == QueryException # noqa: E721
63- assert __class__ == QueryException # noqa: E721
64-
6562 args = []
6663
6764 if self ._description is not None :
@@ -70,12 +67,11 @@ def __repr__(self) -> str:
7067 if self ._query is not None :
7168 args .append (("query" , self ._query ))
7269
73- result = "{}(" .format (__class__ .__name__ )
70+ result = "{}(" .format (type ( self ) .__name__ )
7471 sep = ""
7572 for a in args :
76- if a [1 ] is not None :
77- result += sep + a [0 ] + "=" + repr (a [1 ])
78- sep = ", "
73+ result += sep + a [0 ] + "=" + repr (a [1 ])
74+ sep = ", "
7975 continue
8076 result += ")"
8177 return result
@@ -136,9 +132,6 @@ def files(self) -> typing.Optional[typing.Iterable]:
136132 return self ._files
137133
138134 def __repr__ (self ) -> str :
139- assert type (self ) == StartNodeException # noqa: E721
140- assert __class__ == StartNodeException # noqa: E721
141-
142135 args = []
143136
144137 if self ._description is not None :
@@ -147,12 +140,11 @@ def __repr__(self) -> str:
147140 if self ._files is not None :
148141 args .append (("files" , self ._files ))
149142
150- result = "{}(" .format (__class__ .__name__ )
143+ result = "{}(" .format (type ( self ) .__name__ )
151144 sep = ""
152145 for a in args :
153- if a [1 ] is not None :
154- result += sep + a [0 ] + "=" + repr (a [1 ])
155- sep = ", "
146+ result += sep + a [0 ] + "=" + repr (a [1 ])
147+ sep = ", "
156148 continue
157149 result += ")"
158150 return result
0 commit comments