Python - Get Object Attributes With a Dir Function

Publié le: 16 août 2021
sur la chaîne: codevev
485
28

#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:
Blog: https://evgenyurubkov.com
Twitter:   / evgenyurubkov  
Instagram:   / evgenyurubkov  
Youtube:    / @codevev  


Sur cette page du site, vous pouvez voir la vidéo en ligne Python - Get Object Attributes With a Dir Function durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur codevev 16 août 2021, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 485 fois et il a aimé 28 téléspectateurs. Bon visionnage!