Get the App
SLTechnology News&Howtos  ›  Development  › 

How to parse Python__ double Dash Parameter Code

Shulou Source: shulou.com Published: 2022-06-03 05:06:40 10月01日 Update

In this issue, the editor will bring you about how to parse the Python__ double-underlined parameter code. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.

The code is as follows

'' > Class1.__doc__ # type help information 'Class1 Doc.' > Class1.__name__ # type name' Class1' > Class1.__module__ # type module'_ _ main__' > base class inherited by the Class1.__bases__ # type (,) > Class1.__dict__ # type dictionary to store all type member information. > Class1 (). _ _ class__ # type > Class1 (). _ _ module__ # instance type module'_ _ main__' > Class1 (). _ _ dict__ # object dictionary, which stores all instance member information. Class Ren (object):''ok,it's crazy''' name =' a human being' @ staticmethod def look (): return "ok" class Men (Ren): sex = "male" class Women (Ren): sex = "female" class Baby (Women): sex = "children" if _ name__ = "_ main__": r = Men () print (Ren.__dict__, "_ dict__") print (Ren.__doc__) "_ doc__") print (Men.__doc__, "_ doc__") print (Ren.__bases__, "_ bases__") print (Baby.__bases__ [0]. _ bases__, "_ bases__") print (Baby.__bases__ [0]. _ dict__, "_ dict__") print (Baby.__dict__ "_ _ dict__") print (Men.__bases__ [0] (), "_ _ bases__") print (Men.__name__, "_ _ name__") print (r.roomproof classrooms _ (), "_ _ class__") print (r.creative modulematching, "_ _ class__") print (Men.__module__, "_ _ class__") print (_ _ file__)

Result

{'_ module__':'_ main__','_ doc__': "ok,it's crazy", 'name':' a human being', 'look':,' _ _ dict__':,'_ _ weakref__':} _ _ dict__ok,it's crazy _ _ doc__None _ doc__ (,) _ bases__ ( ) _ _ bases__ {'_ module__':'_ _ main__', 'sex':' female','_ _ doc__': None} _ _ dict__ {'_ _ module__':'_ _ main__', 'sex':' children' '_ _ doc__': None} _ _ dict__ bases__Men _ _ name__ class____main__ class____main__ class__D:/Projects/MxShop/tester.py

The above is the editor for you to share how to parse the Python__ double-dashed parameter code, if you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

Tags: Type code information parameter content dictionary instance member location module analysis storage professional small and medium rich in content name object that is article more Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Shulou Information vpn Huawei Linux