{"id":3616,"date":"2021-04-24T17:09:54","date_gmt":"2021-04-24T11:39:54","guid":{"rendered":"https:\/\/python-programs.com\/?p=3616"},"modified":"2021-11-22T18:38:45","modified_gmt":"2021-11-22T13:08:45","slug":"python-programming-pre-defined-attributes","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-programming-pre-defined-attributes\/","title":{"rendered":"Python Programming – Pre-Defined Attributes"},"content":{"rendered":"

In this Page, We are Providing Python Programming – Pre-Defined Attributes. Students can visit for more Detail and Explanation of Python Handwritten Notes<\/a>\u00a0Pdf.<\/p>\n

Python Programming – Pre-Defined Attributes<\/h2>\n

Pre-defined attributes<\/strong><\/p>\n

Class and class instance objects has some pre-defined attributes:<\/p>\n

Class object<\/strong><\/p>\n

Some pre-defined attributes of class object are:<\/p>\n

__name__
\nThis attribute give the class name.<\/p>\n

>>> MYClass . __name__\r\n' MYClass '<\/pre>\n

__module__
\nThis attribute give the module name.in which the class was defined.<\/p>\n

>>> MYClass . ___module___\r\n' ___main___ '<\/pre>\n

___dict___
\nA class has a namespace implemented by a dictionary object. Class attribute references are translated to lookups in this dictionary, e.g., MyClass . i is translated to MyClass .___dict___ [ ” i ” ].<\/p>\n

>>> MyClass.___dict___\r\n{ ' i ' : 12345 , '___module___' : '___main___ ' , '___doc___ ': ' A simple example class ' , ' f ' : <function f at 0x0640A070>}<\/pre>\n

___bases___
\nThis attribute give the tuple (possibly empty or a singleton) containing the base classes.<\/p>\n

>>> MyClass.___bases___.\r\n( )<\/pre>\n

___doc___
\nThis attribute give the class documentation string, or None, if not defined.<\/p>\n

>>> MyClass.___doc___ \r\n' A simple example class '<\/pre>\n

Class instance object<\/strong>
\nSome pre-defined attributes of class instance object are:<\/p>\n

___dict___
\nThis give attribute dictionary of class instance.<\/p>\n

>>> x. ___dict___ \r\n{ }<\/pre>\n

___class___
\nThis give the instance’s class.<\/p>\n

>>> x. ___class____ \r\n<class ___main___ .MyClass at 0x063DA880><\/pre>\n","protected":false},"excerpt":{"rendered":"

In this Page, We are Providing Python Programming – Pre-Defined Attributes. Students can visit for more Detail and Explanation of Python Handwritten Notes\u00a0Pdf. Python Programming – Pre-Defined Attributes Pre-defined attributes Class and class instance objects has some pre-defined attributes: Class object Some pre-defined attributes of class object are: __name__ This attribute give the class name. …<\/p>\n

Python Programming – Pre-Defined Attributes<\/span> Read More »<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[5],"tags":[],"yoast_head":"\nPython Programming - Pre-Defined Attributes - Python Programs<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/python-programs.com\/python-programming-pre-defined-attributes\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Programming - Pre-Defined Attributes - Python Programs\" \/>\n<meta property=\"og:description\" content=\"In this Page, We are Providing Python Programming – Pre-Defined Attributes. Students can visit for more Detail and Explanation of Python Handwritten Notes\u00a0Pdf. Python Programming – Pre-Defined Attributes Pre-defined attributes Class and class instance objects has some pre-defined attributes: Class object Some pre-defined attributes of class object are: __name__ This attribute give the class name. … Python Programming – Pre-Defined Attributes Read More »\" \/>\n<meta property=\"og:url\" content=\"https:\/\/python-programs.com\/python-programming-pre-defined-attributes\/\" \/>\n<meta property=\"og:site_name\" content=\"Python Programs\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/btechgeeks\" \/>\n<meta property=\"article:published_time\" content=\"2021-04-24T11:39:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-11-22T13:08:45+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@btech_geeks\" \/>\n<meta name=\"twitter:site\" content=\"@btech_geeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prasanna\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https:\/\/python-programs.com\/#organization\",\"name\":\"BTech Geeks\",\"url\":\"https:\/\/python-programs.com\/\",\"sameAs\":[\"https:\/\/www.instagram.com\/btechgeeks\/\",\"https:\/\/www.linkedin.com\/in\/btechgeeks\",\"https:\/\/in.pinterest.com\/btechgeek\/\",\"https:\/\/www.youtube.com\/channel\/UC9MlCqdJ3lKqz2p5114SDIg\",\"https:\/\/www.facebook.com\/btechgeeks\",\"https:\/\/twitter.com\/btech_geeks\"],\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/python-programs.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/python-programs.com\/wp-content\/uploads\/2020\/11\/BTechGeeks.png\",\"contentUrl\":\"https:\/\/python-programs.com\/wp-content\/uploads\/2020\/11\/BTechGeeks.png\",\"width\":350,\"height\":70,\"caption\":\"BTech Geeks\"},\"image\":{\"@id\":\"https:\/\/python-programs.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/python-programs.com\/#website\",\"url\":\"https:\/\/python-programs.com\/\",\"name\":\"Python Programs\",\"description\":\"Python Programs with Examples, How To Guides on Python\",\"publisher\":{\"@id\":\"https:\/\/python-programs.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/python-programs.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/python-programs.com\/python-programming-pre-defined-attributes\/#webpage\",\"url\":\"https:\/\/python-programs.com\/python-programming-pre-defined-attributes\/\",\"name\":\"Python Programming - Pre-Defined Attributes - Python Programs\",\"isPartOf\":{\"@id\":\"https:\/\/python-programs.com\/#website\"},\"datePublished\":\"2021-04-24T11:39:54+00:00\",\"dateModified\":\"2021-11-22T13:08:45+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/python-programs.com\/python-programming-pre-defined-attributes\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/python-programs.com\/python-programming-pre-defined-attributes\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/python-programs.com\/python-programming-pre-defined-attributes\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/python-programs.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python Programming – Pre-Defined Attributes\"}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/python-programs.com\/python-programming-pre-defined-attributes\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/python-programs.com\/python-programming-pre-defined-attributes\/#webpage\"},\"author\":{\"@id\":\"https:\/\/python-programs.com\/#\/schema\/person\/ea8ce699662f0d7e248e52fe080b85bb\"},\"headline\":\"Python Programming – Pre-Defined Attributes\",\"datePublished\":\"2021-04-24T11:39:54+00:00\",\"dateModified\":\"2021-11-22T13:08:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/python-programs.com\/python-programming-pre-defined-attributes\/#webpage\"},\"wordCount\":158,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/python-programs.com\/#organization\"},\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/python-programs.com\/python-programming-pre-defined-attributes\/#respond\"]}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/python-programs.com\/#\/schema\/person\/ea8ce699662f0d7e248e52fe080b85bb\",\"name\":\"Prasanna\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/python-programs.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/174540ad43736c7d1a4c4f83c775e74d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/174540ad43736c7d1a4c4f83c775e74d?s=96&d=mm&r=g\",\"caption\":\"Prasanna\"},\"url\":\"https:\/\/python-programs.com\/author\/prasanna\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python Programming - Pre-Defined Attributes - Python Programs","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/python-programs.com\/python-programming-pre-defined-attributes\/","og_locale":"en_US","og_type":"article","og_title":"Python Programming - Pre-Defined Attributes - Python Programs","og_description":"In this Page, We are Providing Python Programming – Pre-Defined Attributes. Students can visit for more Detail and Explanation of Python Handwritten Notes\u00a0Pdf. Python Programming – Pre-Defined Attributes Pre-defined attributes Class and class instance objects has some pre-defined attributes: Class object Some pre-defined attributes of class object are: __name__ This attribute give the class name. … Python Programming – Pre-Defined Attributes Read More »","og_url":"https:\/\/python-programs.com\/python-programming-pre-defined-attributes\/","og_site_name":"Python Programs","article_publisher":"https:\/\/www.facebook.com\/btechgeeks","article_published_time":"2021-04-24T11:39:54+00:00","article_modified_time":"2021-11-22T13:08:45+00:00","twitter_card":"summary_large_image","twitter_creator":"@btech_geeks","twitter_site":"@btech_geeks","twitter_misc":{"Written by":"Prasanna","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Organization","@id":"https:\/\/python-programs.com\/#organization","name":"BTech Geeks","url":"https:\/\/python-programs.com\/","sameAs":["https:\/\/www.instagram.com\/btechgeeks\/","https:\/\/www.linkedin.com\/in\/btechgeeks","https:\/\/in.pinterest.com\/btechgeek\/","https:\/\/www.youtube.com\/channel\/UC9MlCqdJ3lKqz2p5114SDIg","https:\/\/www.facebook.com\/btechgeeks","https:\/\/twitter.com\/btech_geeks"],"logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/python-programs.com\/#\/schema\/logo\/image\/","url":"https:\/\/python-programs.com\/wp-content\/uploads\/2020\/11\/BTechGeeks.png","contentUrl":"https:\/\/python-programs.com\/wp-content\/uploads\/2020\/11\/BTechGeeks.png","width":350,"height":70,"caption":"BTech Geeks"},"image":{"@id":"https:\/\/python-programs.com\/#\/schema\/logo\/image\/"}},{"@type":"WebSite","@id":"https:\/\/python-programs.com\/#website","url":"https:\/\/python-programs.com\/","name":"Python Programs","description":"Python Programs with Examples, How To Guides on Python","publisher":{"@id":"https:\/\/python-programs.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/python-programs.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/python-programs.com\/python-programming-pre-defined-attributes\/#webpage","url":"https:\/\/python-programs.com\/python-programming-pre-defined-attributes\/","name":"Python Programming - Pre-Defined Attributes - Python Programs","isPartOf":{"@id":"https:\/\/python-programs.com\/#website"},"datePublished":"2021-04-24T11:39:54+00:00","dateModified":"2021-11-22T13:08:45+00:00","breadcrumb":{"@id":"https:\/\/python-programs.com\/python-programming-pre-defined-attributes\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/python-programs.com\/python-programming-pre-defined-attributes\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/python-programs.com\/python-programming-pre-defined-attributes\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/python-programs.com\/"},{"@type":"ListItem","position":2,"name":"Python Programming – Pre-Defined Attributes"}]},{"@type":"Article","@id":"https:\/\/python-programs.com\/python-programming-pre-defined-attributes\/#article","isPartOf":{"@id":"https:\/\/python-programs.com\/python-programming-pre-defined-attributes\/#webpage"},"author":{"@id":"https:\/\/python-programs.com\/#\/schema\/person\/ea8ce699662f0d7e248e52fe080b85bb"},"headline":"Python Programming – Pre-Defined Attributes","datePublished":"2021-04-24T11:39:54+00:00","dateModified":"2021-11-22T13:08:45+00:00","mainEntityOfPage":{"@id":"https:\/\/python-programs.com\/python-programming-pre-defined-attributes\/#webpage"},"wordCount":158,"commentCount":0,"publisher":{"@id":"https:\/\/python-programs.com\/#organization"},"articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/python-programs.com\/python-programming-pre-defined-attributes\/#respond"]}]},{"@type":"Person","@id":"https:\/\/python-programs.com\/#\/schema\/person\/ea8ce699662f0d7e248e52fe080b85bb","name":"Prasanna","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/python-programs.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/174540ad43736c7d1a4c4f83c775e74d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/174540ad43736c7d1a4c4f83c775e74d?s=96&d=mm&r=g","caption":"Prasanna"},"url":"https:\/\/python-programs.com\/author\/prasanna\/"}]}},"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/posts\/3616"}],"collection":[{"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/comments?post=3616"}],"version-history":[{"count":1,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/posts\/3616\/revisions"}],"predecessor-version":[{"id":3618,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/posts\/3616\/revisions\/3618"}],"wp:attachment":[{"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/media?parent=3616"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/categories?post=3616"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/tags?post=3616"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}