Python - Get Object Attributes With a Dir Function

preview_player
Показать описание
#Python #Shorts
Sometimes, especially when working with other people's code, it may be nice to have a list of all class attributes (or properties). Python makes it really easy once again to accomplish this goal. All we need to do is call the built-in "dir" method on an instance of a class, and voila, we get the whole list of attributes.

-------------------------------------------------------------------------------------
Links:
Рекомендации по теме