python type(x).__name__ vs x.__class__.__name__ (intermediate) anthony explains #006

preview_player
Показать описание
very short one, I explain why I prefer type(x).__name__ vs x.__class__.__name__. thanks to @alikus for the question!

==========

I won't ask for subscriptions / likes / comments in videos but it really helps the channel. If you have any suggestions or things you'd like to see please comment below!
Рекомендации по теме
Комментарии
Автор

Is the different behaviour with Python 2's old style classes the reason PEP 8 recommends against doing "type(obj) is type(1)" and instead doing "isinstance(obj, int)"?

domdf