{"id":544,"date":"2020-10-15T03:08:00","date_gmt":"2020-10-15T03:08:00","guid":{"rendered":"https:\/\/www.pythontutorial.net\/?page_id=544"},"modified":"2025-03-31T10:15:48","modified_gmt":"2025-03-31T10:15:48","slug":"python-abstract-class","status":"publish","type":"page","link":"https:\/\/www.pythontutorial.net\/python-oop\/python-abstract-class\/","title":{"rendered":"Python Abstract Classes"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you&#8217;ll learn about Python Abstract classes and how to use it to create a blueprint for other classes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='introduction-to-python-abstract-classes'>Introduction to Python Abstract Classes <a href=\"#introduction-to-python-abstract-classes\" class=\"anchor\" id=\"introduction-to-python-abstract-classes\" title=\"Anchor for Introduction to Python Abstract Classes\">#<\/a><\/h2>\n\n\n\n<p>In object-oriented programming, an abstract class is a <a href=\"https:\/\/www.pythontutorial.net\/python-oop\/python-class\/\">class<\/a> that cannot be instantiated. However, you can create classes that inherit from an abstract class.<\/p>\n\n\n\n<p>Typically, you use an abstract class to create a blueprint for other classes.<\/p>\n\n\n\n<p>Similarly, an abstract method is an method without an implementation. An abstract class may or may not include abstract methods.<\/p>\n\n\n\n<p>Python doesn&#8217;t directly support abstract classes. But it does offer a <a href=\"https:\/\/www.pythontutorial.net\/python-basics\/python-module\/\">module<\/a> that allows you to define abstract classes.<\/p>\n\n\n\n<p>To define an abstract class, you use the <code>abc<\/code> (abstract base class) module.<\/p>\n\n\n\n<p>The <code>abc<\/code> module provides you with the infrastructure for defining abstract base classes.<\/p>\n\n\n\n<p>For example:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\"><span class=\"hljs-keyword\">from<\/span> abc <span class=\"hljs-keyword\">import<\/span> ABC\n\n\n<span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">AbstractClassName<\/span><span class=\"hljs-params\">(ABC)<\/span>:<\/span>\n    <span class=\"hljs-keyword\">pass<\/span>\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>To define an abstract method, you use the <code>@abstractmethod<\/code> decorator:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\"><span class=\"hljs-keyword\">from<\/span> abc <span class=\"hljs-keyword\">import<\/span> ABC, abstractmethod\n\n\n<span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">AbstractClassName<\/span><span class=\"hljs-params\">(ABC)<\/span>:<\/span>\n<span class=\"hljs-meta\">    @abstractmethod<\/span>\n    <span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">abstract_method_name<\/span><span class=\"hljs-params\">(self)<\/span>:<\/span>\n        <span class=\"hljs-keyword\">pass<\/span>\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id='python-abstract-class-example'>Python abstract class example <a href=\"#python-abstract-class-example\" class=\"anchor\" id=\"python-abstract-class-example\" title=\"Anchor for Python abstract class example\">#<\/a><\/h2>\n\n\n\n<p>Suppose that you need to develop a payroll program for a company.<\/p>\n\n\n\n<p>The company has two groups of employees: full-time employees and hourly employees. The full-time employees get a fixed salary while the hourly employees get paid by hourly wages for their services.<\/p>\n\n\n\n<p>The payroll program needs to print out a payroll that includes employee names and their monthly salaries.<\/p>\n\n\n\n<p>To model the payroll program in an object-oriented way, you may come up with the following classes: <code>Employee<\/code>, <code>FulltimeEmployee<\/code>, <code>HourlyEmployee<\/code>, and <code>Payroll<\/code>.<\/p>\n\n\n\n<p>To structure the program, we&#8217;ll use <a href=\"https:\/\/www.pythontutorial.net\/python-basics\/python-module\/\">modules<\/a>, where each class is placed in a separate module (or file).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id='the-employee-class'>The Employee class <a href=\"#the-employee-class\" class=\"anchor\" id=\"the-employee-class\" title=\"Anchor for The Employee class\">#<\/a><\/h3>\n\n\n\n<p>The <code>Employee<\/code> class represents an employee, either full-time or hourly. The <code>Employee<\/code> class should be an abstract class because there&#8217;re only full-time employees and hourly employees, no general employees exist.<\/p>\n\n\n\n<p>The <code>Employee<\/code> class should have a property that returns the full name of an employee. In addition, it should have a method that calculates salary. The method for calculating salary should be an abstract method.<\/p>\n\n\n\n<p>The following defines the <code>Employee<\/code> abstract class:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\"><span class=\"hljs-keyword\">from<\/span> abc <span class=\"hljs-keyword\">import<\/span> ABC, abstractmethod\n\n\n<span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">Employee<\/span><span class=\"hljs-params\">(ABC)<\/span>:<\/span>\n    <span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">__init__<\/span><span class=\"hljs-params\">(self, first_name, last_name)<\/span>:<\/span>\n        self.first_name = first_name\n        self.last_name = last_name\n\n<span class=\"hljs-meta\">    @property<\/span>\n    <span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">full_name<\/span><span class=\"hljs-params\">(self)<\/span>:<\/span>\n        <span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-string\">f\"<span class=\"hljs-subst\">{self.first_name}<\/span> <span class=\"hljs-subst\">{self.last_name}<\/span>\"<\/span>\n\n<span class=\"hljs-meta\">    @abstractmethod<\/span>\n    <span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">get_salary<\/span><span class=\"hljs-params\">(self)<\/span>:<\/span>\n        <span class=\"hljs-keyword\">pass<\/span>\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id='the-fulltimeemployee-class'>The FulltimeEmployee class <a href=\"#the-fulltimeemployee-class\" class=\"anchor\" id=\"the-fulltimeemployee-class\" title=\"Anchor for The FulltimeEmployee class\">#<\/a><\/h3>\n\n\n\n<p>The <code>FulltimeEmployee<\/code> class inherits from the <code>Employee<\/code> class. It&#8217;ll provide the implementation for the <code>get_salary()<\/code> method.<\/p>\n\n\n\n<p>Since full-time employees get fixed salaries, you can initialize the salary in the constructor of the class.<\/p>\n\n\n\n<p>The following illustrates the <code>FulltimeEmployee<\/code> class:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\"><span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">FulltimeEmployee<\/span><span class=\"hljs-params\">(Employee)<\/span>:<\/span>\n    <span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">__init__<\/span><span class=\"hljs-params\">(self, first_name, last_name, salary)<\/span>:<\/span>\n        super().__init__(first_name, last_name)\n        self.salary = salary\n\n    <span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">get_salary<\/span><span class=\"hljs-params\">(self)<\/span>:<\/span>\n        <span class=\"hljs-keyword\">return<\/span> self.salary\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id='the-hourlyemployee-class'>The HourlyEmployee class <a href=\"#the-hourlyemployee-class\" class=\"anchor\" id=\"the-hourlyemployee-class\" title=\"Anchor for The HourlyEmployee class\">#<\/a><\/h3>\n\n\n\n<p>The <code>HourlyEmployee<\/code> also inherits from the <code>Employee<\/code> class. However, hourly employees get paid by working hours and their rates. Therefore, you can initialize this information in the constructor of the class.<\/p>\n\n\n\n<p>To calculate the salary for the hourly employees, you multiply the working hours and rates.<\/p>\n\n\n\n<p>The following shows the <code>HourlyEmployee<\/code> class:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\"><span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">HourlyEmployee<\/span><span class=\"hljs-params\">(Employee)<\/span>:<\/span>\n    <span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">__init__<\/span><span class=\"hljs-params\">(self, first_name, last_name, worked_hours, rate)<\/span>:<\/span>\n        super().__init__(first_name, last_name)\n        self.worked_hours = worked_hours\n        self.rate = rate\n\n    <span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">get_salary<\/span><span class=\"hljs-params\">(self)<\/span>:<\/span>\n        <span class=\"hljs-keyword\">return<\/span> self.worked_hours * self.rate\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id='the-payroll-class'>The Payroll class <a href=\"#the-payroll-class\" class=\"anchor\" id=\"the-payroll-class\" title=\"Anchor for The Payroll class\">#<\/a><\/h2>\n\n\n\n<p>The <code>Payroll<\/code> class will have a method that adds an employee to the employee list and print out the payroll.<\/p>\n\n\n\n<p>Since fulltime and hourly employees share the same interfaces (<code>full_time<\/code> property and <code>get_salary()<\/code> method). Therefore, the Payroll class doesn&#8217;t need to distinguish them.<\/p>\n\n\n\n<p>The following shows the <code>Payroll<\/code> class:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\"><span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">Payroll<\/span>:<\/span>\n    <span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">__init__<\/span><span class=\"hljs-params\">(self)<\/span>:<\/span>\n        self.employee_list = &#91;]\n\n    <span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">add<\/span><span class=\"hljs-params\">(self, employee)<\/span>:<\/span>\n        self.employee_list.append(employee)\n\n    <span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">print<\/span><span class=\"hljs-params\">(self)<\/span>:<\/span>\n        <span class=\"hljs-keyword\">for<\/span> e <span class=\"hljs-keyword\">in<\/span> self.employee_list:\n            print(<span class=\"hljs-string\">f\"<span class=\"hljs-subst\">{e.full_name}<\/span> \\t $<span class=\"hljs-subst\">{e.get_salary()}<\/span>\"<\/span>)\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id='the-main-program'>The main program <a href=\"#the-main-program\" class=\"anchor\" id=\"the-main-program\" title=\"Anchor for The main program\">#<\/a><\/h3>\n\n\n\n<p>The following <code>app.py<\/code> uses the <code>FulltimeEmployee<\/code>, <code>HourlyEmployee<\/code>, and <code>Payroll<\/code> classes to print out the payroll of five employees.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\"><span class=\"hljs-keyword\">from<\/span> fulltimeemployee <span class=\"hljs-keyword\">import<\/span> FulltimeEmployee\n<span class=\"hljs-keyword\">from<\/span> hourlyemployee <span class=\"hljs-keyword\">import<\/span> HourlyEmployee\n<span class=\"hljs-keyword\">from<\/span> payroll <span class=\"hljs-keyword\">import<\/span> Payroll\n\npayroll = Payroll()\n\npayroll.add(FulltimeEmployee(<span class=\"hljs-string\">'John'<\/span>, <span class=\"hljs-string\">'Doe'<\/span>, <span class=\"hljs-number\">6000<\/span>))\npayroll.add(FulltimeEmployee(<span class=\"hljs-string\">'Jane'<\/span>, <span class=\"hljs-string\">'Doe'<\/span>, <span class=\"hljs-number\">6500<\/span>))\npayroll.add(HourlyEmployee(<span class=\"hljs-string\">'Jenifer'<\/span>, <span class=\"hljs-string\">'Smith'<\/span>, <span class=\"hljs-number\">200<\/span>, <span class=\"hljs-number\">50<\/span>))\npayroll.add(HourlyEmployee(<span class=\"hljs-string\">'David'<\/span>, <span class=\"hljs-string\">'Wilson'<\/span>, <span class=\"hljs-number\">150<\/span>, <span class=\"hljs-number\">100<\/span>))\npayroll.add(HourlyEmployee(<span class=\"hljs-string\">'Kevin'<\/span>, <span class=\"hljs-string\">'Miller'<\/span>, <span class=\"hljs-number\">100<\/span>, <span class=\"hljs-number\">150<\/span>))\n\npayroll.print()<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">John Doe         $<span class=\"hljs-number\">6000<\/span>\nJane Doe         $<span class=\"hljs-number\">6500<\/span>\nJenifer Smith    $<span class=\"hljs-number\">10000<\/span>\nDavid Wilson     $<span class=\"hljs-number\">15000<\/span>\nKevin Miller     $<span class=\"hljs-number\">15000<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id='when-to-use-abstract-classes'>When to use abstract classes <a href=\"#when-to-use-abstract-classes\" class=\"anchor\" id=\"when-to-use-abstract-classes\" title=\"Anchor for When to use abstract classes\">#<\/a><\/h2>\n\n\n\n<p>In practice, you use abstract classes to share the code among several closely related classes. In the payroll program, all subclasses of the <code>Employee<\/code> class share the same <code>full_name<\/code> property.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='summary'>Summary <a href=\"#summary\" class=\"anchor\" id=\"summary\" title=\"Anchor for Summary\">#<\/a><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Abstract classes are classes that you cannot create instances from.<\/li>\n\n\n\n<li>Use <code>abc<\/code> module to define abstract classes.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id='quiz'>Quiz <a href=\"#quiz\" class=\"anchor\" id=\"quiz\" title=\"Anchor for Quiz\">#<\/a><\/h2>\n\n\n\n<iframe loading=\"lazy\"\n  name=\"quiz\"\n  src=\"\/quiz\/?quiz=abstract-class\"\n  height=\"700\"\n  width=\"600\"\n  class=\"iframe\"\n><\/iframe>\n\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Was this tutorial helpful ?<\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"544\"\n\t\t\t\tdata-post-url=\"https:\/\/www.pythontutorial.net\/python-oop\/python-abstract-class\/\"\n\t\t\t\tdata-post-title=\"Python Abstract Classes\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"544\"\n\t\t\t\tdata-post-url=\"https:\/\/www.pythontutorial.net\/python-oop\/python-abstract-class\/\"\n\t\t\t\tdata-post-title=\"Python Abstract Classes\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\t\t\t<input type=\"button\" name=\"wth-submit\" class=\"wth-btn wth-btn-submit\" id=\"wth-submit\" \/>\n\t\t\t<input type=\"button\" class=\"wth-btn wth-btn-cancel\" value=\"Cancel\" \/>\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, you&#8217;ll learn about Python Abstract classes and how to use it to create a blueprint for other classes.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":417,"menu_order":25,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-544","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages\/544","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/comments?post=544"}],"version-history":[{"count":1,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages\/544\/revisions"}],"predecessor-version":[{"id":7317,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages\/544\/revisions\/7317"}],"up":[{"embeddable":true,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages\/417"}],"wp:attachment":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/media?parent=544"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}