Replace "__class__" with "type()".

pull/493/head
KmolYuan 2019-09-10 17:34:12 +08:00
parent d6dc4eaf6e
commit 1c18ca015e
1 changed files with 2 additions and 2 deletions

View File

@ -54,7 +54,7 @@ cdef class Params:
return params return params
def __repr__(self) -> str: def __repr__(self) -> str:
cdef str m = f"{self.__class__.__name__}([" cdef str m = f"{type(self).__name__}(["
cdef size_t i cdef size_t i
cdef size_t s = self.param_list.size() cdef size_t s = self.param_list.size()
for i in range(s): for i in range(s):
@ -227,7 +227,7 @@ cdef class Entity:
cdef int g = <int>self.g cdef int g = <int>self.g
cdef str t = _NAME_OF_ENTITIES[<int>self.t] cdef str t = _NAME_OF_ENTITIES[<int>self.t]
return ( return (
f"{self.__class__.__name__}" f"{type(self).__name__}"
f"(handle={h}, group={g}, type=<{t}>, is_3d={self.is_3d()}, params={self.params})" f"(handle={h}, group={g}, type=<{t}>, is_3d={self.is_3d()}, params={self.params})"
) )