{"id":1000,"date":"2023-02-22T18:05:00","date_gmt":"2023-02-22T12:35:00","guid":{"rendered":"https:\/\/geekpython.in\/?p=1000"},"modified":"2023-10-12T21:17:53","modified_gmt":"2023-10-12T15:47:53","slug":"super-in-python","status":"publish","type":"post","link":"https:\/\/geekpython.in\/super-in-python","title":{"rendered":"How To Use super() Function Within Python Classes"},"content":{"rendered":"\n<p>You may have heard the term&nbsp;<strong>inheritance<\/strong>&nbsp;in&nbsp;<strong>object-oriented programming<\/strong>, and if you haven&#8217;t, don&#8217;t worry because we&#8217;ve got your back.<\/p>\n\n\n\n<p><a target=\"_blank\" href=\"https:\/\/geekpython.in\/class-inheritance-in-python\" rel=\"noreferrer noopener\"><strong>Inheritance<\/strong><\/a>&nbsp;is one of the four pillars of object-oriented programming, and it can be defined as a&nbsp;<strong>mechanism that allows a specific class to inherit the attributes and methods of the parent class without having to implement them again<\/strong>.<\/p>\n\n\n\n<p>Python has an excellent function called&nbsp;<code>super()<\/code>&nbsp;that allows the parent class&#8217;s attributes and methods to be fully accessible within a subclass.<\/p>\n\n\n\n<p>What does the\u00a0<code>super()<\/code>\u00a0function do and how does it help with class inheritance in Python?<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<p class=\"responsive-video-wrap clr\"><iframe loading=\"lazy\" title=\"Python&#039;s super() Function in 2 Minutes | 2MinutesPy\" width=\"1200\" height=\"675\" src=\"https:\/\/www.youtube.com\/embed\/giOT0dBkIaQ?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe><\/p>\n<\/div><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"heading-super-in-python\"><a href=\"https:\/\/geekpython.in\/super-in-python#heading-super-in-python\"><\/a>Super in Python<\/h1>\n\n\n\n<p>To put it simply, the&nbsp;<code>super()<\/code>&nbsp;function extends the functionality of the superclass within the subclass or derived class. Assume we created a class and wanted to extend the functionality of a previously created class within that specific class; in that case, we&#8217;ll use the&nbsp;<code>super()<\/code>&nbsp;function.<\/p>\n\n\n\n<p>Let&#8217;s look at an example to get a better understanding of the&nbsp;<code>super()<\/code>&nbsp;function in Python.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \"># Super method demonstration\nclass BestFriend:\n    def __init__(self):\n        self.name1 = \"Rishu\"\n        self.name2 = \"Yashwant\"\n        self.name3 = \"Abhishek\"\n\nclass Friends(BestFriend):\n    def __init__(self):\n        super().__init__()\n\n    def friends(self):\n        print(self.name1)\n        print(self.name2)\n        print(self.name3)\n\nobj = Friends()\nobj.friends()<\/pre><\/div>\n\n\n\n<p>We made two classes,&nbsp;<code>BestFriend<\/code>&nbsp;and&nbsp;<code>Friend<\/code>, with the subclass or derived class&nbsp;<code>Friend<\/code>&nbsp;inheriting from the parent class&nbsp;<code>BestFriend<\/code>. However, in order to fully access the parent class within a derived class, we instantiated the parent class using the&nbsp;<code>super()<\/code>&nbsp;function.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">Rishu\nYashwant\nAbhishek<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"heading-syntax\"><a href=\"https:\/\/geekpython.in\/super-in-python#heading-syntax\"><\/a>Syntax<\/h2>\n\n\n\n<p>The syntax of the&nbsp;<code>super()<\/code>&nbsp;function can be written as the following<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">class X(Z):\n    def method(self, args):\n        super(X, self).method(args)<\/pre><\/div>\n\n\n\n<p>Here:<\/p>\n\n\n\n<p><code>X<\/code>&nbsp;&#8211; is an optional parameter that represents the name of the subclass.<\/p>\n\n\n\n<p><code>self<\/code>&nbsp;&#8211; is the instance object of the derived class&nbsp;<code>X<\/code>.<\/p>\n\n\n\n<p><code>method<\/code>&nbsp;&#8211; is a normal function.<\/p>\n\n\n\n<p><code>args<\/code>&nbsp;&#8211; are the arguments of the function.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"heading-what-super-function-does\"><a href=\"https:\/\/geekpython.in\/super-in-python#heading-what-super-function-does\"><\/a>What&nbsp;does the super() function do?<\/h2>\n\n\n\n<p>We saw earlier how to use the&nbsp;<code>super()<\/code>&nbsp;function within a subclass to extend the functionality of the parent class. And it&#8217;s no surprise that the&nbsp;<code>super()<\/code>&nbsp;function is mostly used to extend the functionality of the parent class within the subclass.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heading-super-function-in-single-inheritance\"><a href=\"https:\/\/geekpython.in\/super-in-python#heading-super-function-in-single-inheritance\"><\/a>super()&nbsp;function in single inheritance<\/h3>\n\n\n\n<p><strong>Single inheritance<\/strong>&nbsp;is one in which the subclass or derived class inherits from a single parent class or superclass.<\/p>\n\n\n\n<p>In the following example, there are two classes:&nbsp;<code>Triangle<\/code>&nbsp;and&nbsp;<code>RightTriangle<\/code>. Both classes have functions&nbsp;<code>area<\/code>&nbsp;that return the area of a triangle and a right-angle triangle.<\/p>\n\n\n\n<p>Then we created instances of both classes,&nbsp;<code>triangle<\/code>&nbsp;and&nbsp;<code>rtriangle<\/code>, and passed them the necessary arguments. Then, using the respective instance variable, we called the function&nbsp;<code>area<\/code>&nbsp;of both classes.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">class Triangle:\n    def __init__(self, a, b):\n        self.a = a\n        self.b = b\n\n    def area(self):\n        return (self.a * self.b) \/ 2\n\nclass RightTriangle:\n    def __init__(self, a, b):\n        self.a = a\n        self.b = b\n\n    def area(self):\n        return (self.a * self.b) \/ 2\n\ntriangle = Triangle(2, 4)\nprint(f\"Area of triangle: {triangle.area()}\")\n\nrtriangle = RightTriangle(2, 3)\nprint(f\"Area of right-angle triangle: {rtriangle.area()}\")<\/pre><\/div>\n\n\n\n<p>We got the following output which was expected from the program.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">Area of triangle: 4.0\nArea of right-angle triangle: 3.0<\/pre><\/div>\n\n\n\n<p>However, by using inheritance and the&nbsp;<code>super()<\/code>&nbsp;function,&nbsp;<strong>we can reduce the amount of time we spend writing the same logic over and over<\/strong>. Let&#8217;s see how we can do it with the aforementioned code.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">class Triangle:\n    def __init__(self, a, b):\n        self.a = a\n        self.b = b\n\n    def area(self):\n        return (self.a * self.b) \/ 2\n\nclass RightTriangle(Triangle):\n    def __init__(self, a, b):\n        super().__init__(a, b)<\/pre><\/div>\n\n\n\n<p>The class&nbsp;<code>RightTriangle<\/code>&nbsp;derives from the parent class&nbsp;<code>Triangle<\/code>, and we extended the functionality of the parent class within the subclass&nbsp;<code>RightTriangle<\/code>&nbsp;by using the&nbsp;<code>super()<\/code>&nbsp;function.<\/p>\n\n\n\n<p>If we call the function&nbsp;<code>area<\/code>&nbsp;using the derived class&nbsp;<code>RightTriangle<\/code>, the code will run without error and we will get the correct output.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">rtriangle = RightTriangle(2, 3)\nprint(f\"Area of right-angle triangle: {rtriangle.area()}\")\n\n----------\nArea of right-angle triangle: 3.0<\/pre><\/div>\n\n\n\n<p>Because the derived class&nbsp;<code>RightTriangle<\/code>&nbsp;has access to the methods in the parent class&nbsp;<code>Triangle<\/code>, the code completed the task successfully.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heading-what-else-super-function-can-do\"><a href=\"https:\/\/geekpython.in\/super-in-python#heading-what-else-super-function-can-do\"><\/a>What else&nbsp;super()&nbsp;function can do?<\/h3>\n\n\n\n<p>We saw the basic usage of the&nbsp;<code>super()<\/code>&nbsp;function in the preceding segment, and we&#8217;ll see many more examples in this segment to help us understand more concepts of the&nbsp;<code>super()<\/code>&nbsp;function.<\/p>\n\n\n\n<p>As we saw earlier, the&nbsp;<code>super()<\/code>&nbsp;function can take two parameters, but it can also be called without any parameters, as shown in the above code.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">class Triangle:\n    def __init__(self, a, b):\n        self.a = a\n        self.b = b\n\n    def area(self):\n        return (self.a * self.b) \/ 2\n\nclass RightTriangle(Triangle):\n    def __init__(self, a, b):\n        super(RightTriangle, self).__init__(a, b)<\/pre><\/div>\n\n\n\n<p>You can see that the derived class&nbsp;<code>RightTriangle<\/code>&nbsp;is the first parameter we passed, and the&nbsp;<code>RightTriangle<\/code>&nbsp;object&nbsp;<code>self<\/code>&nbsp;is the second. The code will continue to function flawlessly as before and won&#8217;t be at all impacted by this.<\/p>\n\n\n\n<p><strong>Calling<\/strong>&nbsp;<code>super(RightTriangle, self)<\/code>&nbsp;<strong>is equivalent to calling<\/strong>&nbsp;<code>super()<\/code>&nbsp;<strong>without parameters. In most cases, however, it is recommended that you use the parameter-free<\/strong>&nbsp;<code>super()<\/code>&nbsp;<strong>function.<\/strong><\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">rtriangle = RightTriangle(2, 3)\nprint(f\"Area of right-angle triangle: {rtriangle.area()}\")\n\n----------\nArea of right-angle triangle: 3.0<\/pre><\/div>\n\n\n\n<p>Another subclass that inherits from the first subclass and extends the functionality of the parent class inside the second subclass can also use&nbsp;<code>super()<\/code>. Let&#8217;s use an example to better understand it.<\/p>\n\n\n\n<p>The function&nbsp;<code>area<\/code>, which was originally inherited from the class&nbsp;<code>Rectangle<\/code>&nbsp;through the subclass&nbsp;<code>Square<\/code>, is extended by the subclass&nbsp;<code>Circle<\/code>&nbsp;in the example below to return the area of the circle.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">class Rectangle:\n    def __init__(self, a, b):\n        self.a = a\n        self.b = b\n\n    def area(self):\n        return self.a * self.b\n\nclass Square(Rectangle):\n    def __init__(self, a):\n        super(Square, self).__init__(a, a)\n\nclass Circle(Square):\n    def c_area(self):\n        circle_area = super().area()\n        return 3.14 * circle_area\n\nobj = Circle(3)\nprint(obj.c_area())<\/pre><\/div>\n\n\n\n<p>If we run the aforementioned code, we will obtain the circle&#8217;s area calculated for a radius of 3.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">28.26<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heading-super-function-in-multiple-inheritance\"><a href=\"https:\/\/geekpython.in\/super-in-python#heading-super-function-in-multiple-inheritance\"><\/a>super()&nbsp;function in multiple inheritance<\/h3>\n\n\n\n<p>After seeing how the&nbsp;<code>super()<\/code>&nbsp;function is used in single inheritance, we will now use examples to show how it is used in multiple inheritance.<\/p>\n\n\n\n<p><strong>Multiple inheritance<\/strong>&nbsp;is a type of inheritance where a subclass inherits from various parent classes.<\/p>\n\n\n\n<p>The class&nbsp;<code>Cylinder<\/code>&nbsp;in the example below inherits from the classes&nbsp;<code>Circle<\/code>&nbsp;and&nbsp;<code>Rectangle<\/code>. Like in the single inheritance example, we used the&nbsp;<code>area<\/code>&nbsp;function via the&nbsp;<code>super()<\/code>&nbsp;function.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">class Rectangle:\n    def __init__(self, a, b):\n        self.a = a\n        self.b = b\n\n    def area(self):\n        return self.a * self.b\n\n\nclass Circle:\n    def __init__(self, a):\n        self.a = a\n\n    def area(self):\n        return 3.14 * (self.a * self.a)\n\n\nclass Cylinder(Rectangle, Circle):\n    def cy_area(self):\n        area = 2 * 3.14 * super().area()\n        area1 = 2 * (super().area())\n        cylinder_area = area + area1\n        return cylinder_area\n\n\nobj = Cylinder(2, 3)\nprint(obj.cy_area())<\/pre><\/div>\n\n\n\n<p>The aim of the code is to print the area of the cylinder, and the function&nbsp;<code>cy_area<\/code>&nbsp;holds the logic to process it.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">49.68<\/pre><\/div>\n\n\n\n<p>The code returns the above output, which is wrong, and this happens because the function&nbsp;<code>area<\/code>&nbsp;we called using the&nbsp;<code>super()<\/code>&nbsp;function is actually coming from the base class&nbsp;<code>Rectangle<\/code>.<\/p>\n\n\n\n<p>If we look at the&nbsp;<strong>MRO (M<\/strong>ethod&nbsp;<strong>R<\/strong>esolution&nbsp;<strong>O<\/strong>rder), that tells Python where to look for the inherited method.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">mro = Cylinder.__mro__\nprint(mro)\n\n----------\n(&lt;class '__main__.Cylinder'&gt;, &lt;class '__main__.Rectangle'&gt;, &lt;class '__main__.Circle'&gt;, &lt;class 'object'&gt;)<\/pre><\/div>\n\n\n\n<p>Here, we can clearly see that Python will look for the inherited methods from the class&nbsp;<code>Rectangle,<\/code>&nbsp;and if the specific method is found in it, it will be used; otherwise, it will move ahead.<\/p>\n\n\n\n<p>However, we want the variable&nbsp;<code>area<\/code>&nbsp;to access the function&nbsp;<code>area<\/code>&nbsp;via the class&nbsp;<code>Rectangle<\/code>&nbsp;and variable&nbsp;<code>area1<\/code>&nbsp;to access the function&nbsp;<code>area<\/code>&nbsp;via the class&nbsp;<code>Circle<\/code>.<\/p>\n\n\n\n<p>You can change the order in which the base classes are inherited, though, if you ever need to use contradictory methods from classes within a subclass.<\/p>\n\n\n\n<p>The solution to this problem is that we can modify the names of the function.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">class Rectangle:\n    def __init__(self, a, b):\n        self.a = a\n        self.b = b\n\n    def r_area(self):\n        return self.a * self.b\n\n\nclass Circle:\n    def __init__(self, a):\n        self.a = a\n\n    def c_area(self):\n        return 3.14 * (self.a * self.a)\n\n\nclass Cylinder(Rectangle, Circle):\n    def cy_area(self):\n        area = 2 * 3.14 * super().r_area()\n        area1 = 2 * (super().c_area())\n        cylinder_area = area + area1\n        return cylinder_area\n\n\nobj = Cylinder(2, 3)\nprint(obj.cy_area())<\/pre><\/div>\n\n\n\n<p>We changed the function&#8217;s name inside the class&nbsp;<code>Rectangle<\/code>&nbsp;and set it to&nbsp;<code>r_area<\/code>. We did the same inside the class&nbsp;<code>Circle<\/code>&nbsp;and set the function&#8217;s name to&nbsp;<code>c_area<\/code>. This gives the issue a short-term solution.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">62.8<\/pre><\/div>\n\n\n\n<p><strong>Note: When multiple inheritance is used, the order of the parent classes determines whether to use this class&#8217; methods first or that class&#8217; methods.<\/strong><\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"heading-conclusion\"><a href=\"https:\/\/geekpython.in\/super-in-python#heading-conclusion\"><\/a>Conclusion<\/h1>\n\n\n\n<p>We used the&nbsp;<code>super()<\/code>&nbsp;function in this tutorial to give subclasses full access to the parent classes&#8217; methods and attributes. We first learned about the&nbsp;<code>super()<\/code>&nbsp;function through an example, and then we looked at the syntax.<\/p>\n\n\n\n<p>Then, using code examples, we delve deep into the&nbsp;<code>super()<\/code>&nbsp;function to understand more concepts. Then we saw the use of&nbsp;<code>super()<\/code>&nbsp;in single and multiple inheritance, as well as a glimpse of the&nbsp;<strong>RMO<\/strong>, which is used in Python to resolve method calls.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\ud83c\udfc6<strong>Other articles you might be interested in if you liked this one<\/strong><\/p>\n\n\n\n<p>\u2705<a target=\"_blank\" href=\"https:\/\/geekpython.in\/class-inheritance-in-python\" rel=\"noreferrer noopener\">Introduction to the different types of class inheritance in Python<\/a>.<\/p>\n\n\n\n<p>\u2705<a target=\"_blank\" href=\"https:\/\/geekpython.in\/access-modifiers-in-python\" rel=\"noreferrer noopener\">Public, Protected and Private access modifiers in Python<\/a>.<\/p>\n\n\n\n<p>\u2705<a target=\"_blank\" href=\"https:\/\/geekpython.in\/match-case-in-python\" rel=\"noreferrer noopener\">Match case statement for pattern matching in Python<\/a>.<\/p>\n\n\n\n<p>\u2705<a target=\"_blank\" href=\"https:\/\/geekpython.in\/render-images-from-flask\" rel=\"noreferrer noopener\">Upload and display images on the frontend using Flask in Python<\/a>.<\/p>\n\n\n\n<p>\u2705<a target=\"_blank\" href=\"https:\/\/geekpython.in\/different-ways-to-reverse-a-python-list\" rel=\"noreferrer noopener\">8 different ways to reverse a Python list<\/a>.<\/p>\n\n\n\n<p>\u2705<a target=\"_blank\" href=\"https:\/\/geekpython.in\/reverse-vs-reversed-in-python\" rel=\"noreferrer noopener\">Reverse vs Reversed function in Python<\/a>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>That&#8217;s all for now<\/strong><\/p>\n\n\n\n<p><strong>Keep Coding\u270c\u270c<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>You may have heard the term&nbsp;inheritance&nbsp;in&nbsp;object-oriented programming, and if you haven&#8217;t, don&#8217;t worry because we&#8217;ve got your back. Inheritance&nbsp;is one of the four pillars of object-oriented programming, and it can be defined as a&nbsp;mechanism that allows a specific class to inherit the attributes and methods of the parent class without having to implement them again. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1002,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"0","ocean_second_sidebar":"0","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"0","ocean_custom_header_template":"0","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"0","ocean_menu_typo_font_family":"0","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"0","ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"off","ocean_gallery_id":[],"footnotes":""},"categories":[2,41],"tags":[40,12,31],"class_list":["post-1000","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","category-function","tag-functions","tag-python","tag-python3","entry","has-media"],"_links":{"self":[{"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/posts\/1000","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/comments?post=1000"}],"version-history":[{"count":5,"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/posts\/1000\/revisions"}],"predecessor-version":[{"id":1560,"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/posts\/1000\/revisions\/1560"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/media\/1002"}],"wp:attachment":[{"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/media?parent=1000"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/categories?post=1000"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/tags?post=1000"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}