@@ -713,7 +713,7 @@ def repr_class(x):
713713 return x
714714
715715 try :
716- return x . __class__ .__name__
716+ return type ( x ) .__name__
717717 except AttributeError :
718718 return repr (type (x ))
719719
@@ -780,17 +780,17 @@ def assert_is_valid_plot_return_object(objs):
780780 if isinstance (objs , (pd .Series , np .ndarray )):
781781 for el in objs .ravel ():
782782 msg = (
783- "one of 'objs' is not a matplotlib Axes instance, type "
784- " encountered {name!r }"
785- ). format ( name = el . __class__ . __name__ )
783+ "one of 'objs' is not a matplotlib Axes instance, "
784+ f"type encountered { repr ( type ( el ). __name__ ) } "
785+ )
786786 assert isinstance (el , (plt .Axes , dict )), msg
787787 else :
788- assert isinstance (objs , (plt .Artist , tuple , dict )), (
789- "objs is neither an ndarray of Artist instances nor a "
790- 'single Artist instance, tuple, or dict, "objs" is a {name!r}' .format (
791- name = objs .__class__ .__name__
792- )
788+ msg = (
789+ "objs is neither an ndarray of Artist instances nor a single "
790+ "ArtistArtist instance, tuple, or dict, 'objs' is a "
791+ f"{ repr (type (objs ).__name__ )} "
793792 )
793+ assert isinstance (objs , (plt .Artist , tuple , dict )), msg
794794
795795
796796def isiterable (obj ):
0 commit comments