@@ -713,7 +713,7 @@ def repr_class(x):
713
713
return x
714
714
715
715
try :
716
- return x . __class__ .__name__
716
+ return type ( x ) .__name__
717
717
except AttributeError :
718
718
return repr (type (x ))
719
719
@@ -780,17 +780,17 @@ def assert_is_valid_plot_return_object(objs):
780
780
if isinstance (objs , (pd .Series , np .ndarray )):
781
781
for el in objs .ravel ():
782
782
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
+ )
786
786
assert isinstance (el , (plt .Axes , dict )), msg
787
787
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__ )} "
793
792
)
793
+ assert isinstance (objs , (plt .Artist , tuple , dict )), msg
794
794
795
795
796
796
def isiterable (obj ):
0 commit comments