{"id":1994,"date":"2020-09-02T04:14:36","date_gmt":"2020-09-02T11:14:36","guid":{"rendered":"https:\/\/renanmf.com\/?p=1994"},"modified":"2020-12-29T10:21:01","modified_gmt":"2020-12-29T13:21:01","slug":"object-oriented-programming-polymorphism-in-python","status":"publish","type":"post","link":"https:\/\/renanmf.com\/object-oriented-programming-polymorphism-in-python\/","title":{"rendered":"Object-Oriented Programming: Polymorphism in Python"},"content":{"rendered":"<p>This is the 4th article in a series on Object-Oriented Programming:<\/p>\n<ul>\n<li><a href=\"https:\/\/renanmf.com\/classes-objects-python\/\">Classes and Objects in Python<\/a><\/li>\n<li><a href=\"https:\/\/renanmf.com\/object-oriented-programming-encapsulation-in-python\/\">Object-Oriented Programming: Encapsulation in Python<\/a><\/li>\n<li><a href=\"https:\/\/renanmf.com\/inheritance-python\/\">Inheritance in Python<\/a><\/li>\n<li><strong><a href=\"https:\/\/renanmf.com\/object-oriented-programming-polymorphism-in-python\/\">Object-Oriented Programming: Polymorphism in Python<\/a><\/strong><\/li>\n<\/ul>\n<p>Read the article about <a href=\"https:\/\/renanmf.com\/inheritance-python\/\">Inheritance<\/a> before diving into this one.<\/p>\n<hr \/>\n<p>Say we want a motorcycle class, we don&#8217;t have to worry about cargo since that&#8217;s a concern for a truck, but not for a motorcycle, we can just inherit the attributes from <code>Vehicle<\/code>, but the <code>accelerate()<\/code> method is different since motorcycles can go faster.<\/p>\n<p>With motorcycles, we let them increase speed by 5 at a time.<\/p>\n<p>Let&#8217;s also reimplement the <code>vehicle_details(self)<\/code> method in the Motorcycle class, changing it a bit to print a slightly different message.<\/p>\n<p>Implement the code below in a &#8216;vehicles.py&#8217; file and execute it.<\/p>\n<pre><code class=\"language-python\">class Vehicle:\n    def __init__(self, year, model, plate_number, current_speed):\n        self.year = year\n        self.model = model\n        self.plate_number = plate_number\n        self.current_speed = current_speed\n\n    def accelerate(self, value):\n        raise NotImplementedError()\n\n    def stop(self):\n        self.current_speed = 0\n\n    def vehicle_details(self):\n        return f&#039;{self.model}-{self.year}-{self.plate_number}&#039;\n\nclass Truck(Vehicle):\n    def __init__(self, year, model, plate_number, current_speed, current_cargo):\n        super().__init__(year, model, plate_number, current_speed)\n        self.current_cargo = current_cargo\n\n    def accelerate(self, value):\n        if(value &lt; 3):\n            self.current_speed += value\n\n    def add_cargo(self, cargo):\n        self.current_cargo += cargo\n\n    def remove_cargo(self, cargo):\n        self.current_cargo -= cargo\n\nclass Motorcycle(Vehicle):\n    def __init__(self, year, model, plate_number, current_speed):\n        super().__init__(year, model, plate_number, current_speed)\n\n    def accelerate(self, value):\n        if(value &lt; 6):\n            self.current_speed += value\n\n    def vehicle_details(self):\n        return f&#039;Motorcycle: {self.model}-{self.year}&#039;\n\nif __name__ == &#039;__main__&#039;:\n    motorcycle = Motorcycle(2018, &#039;AI5&#039;, &#039;AAA0000&#039;, 0)\n    truck = Truck(2015, &#039;V8&#039;, &#039;XYZ1234&#039;, 0, 0)\n    vehicles = [motorcycle, truck]\n    for vehicle in vehicles:\n        vehicle.accelerate(2)\n        vehicle.accelerate(5)\n        print(vehicle.vehicle_details())\n        print(vehicle.current_speed)<\/code><\/pre>\n<p>The output will be:<\/p>\n<pre><code>Motorcycle: AI5-2018\n7\nV8-2015-XYZ1234\n2<\/code><\/pre>\n<p>In the main function, we instantiated two objects, a motorcycle and a truck, then we put them both in a list of vehicles.<\/p>\n<p>We run a <code>for<\/code> loop going through the list and, for each object, we call the <code>accelerate()<\/code> method with 2 and 5, then we print the details and current speed.<\/p>\n<p>As you can see, inside the loop, there is no differentiation between truck or motorcycle when we call any of the methods.<\/p>\n<p>Also notice that the motorcycle object has a speed of 7 while the truck has a speed of 2, because the implementation of <code>accelerate()<\/code> for truck doesn&#8217;t allow a number higher than 2, so 5 does not apply to the truck object, but it does apply to the motorcycle that supports an acceleration of up until 5 at once. So motorcycle gets two accelerations adding to 7, while truck get only one acceleration of 2.<\/p>\n<p>The <code>vehicle_details()<\/code> also produces a message &#8216;Motorcycle: AI5-2018&#8217; for the motorcycle object, while it produces  &#8216;V8-2015-XYZ1234&#8217; for the truck.<\/p>\n<p>The <code>vehicle_details()<\/code> implementation of motorcycle has &#8216;Motorcycle&#8217; at the beginning and doesn&#8217;t print the <code>plate_number<\/code>.<\/p>\n<p>The <code>vehicle_details()<\/code> used by the truck object is the standard that comes from the Vehicle parent class, that prints the model, the year, and the plate_number.<\/p>\n<p>We have <code>accelerate()<\/code> implemented in two different classes, in two different ways, meaning <em>many forms<\/em> of implementation.<\/p>\n<p>This is only possible due to Polymorphism, it comes from the greek roots &quot;poli&quot; (many) and &quot;morphos&quot; (forms).<\/p>\n<p>We also did what is known as <em>method overriding<\/em> when we redefined <code>vehicle_details()<\/code> in the motorcycle class. We simply define a method in the child class with the same name of the method in the parent class and reimplement the body the way we want.<\/p>\n<p>In the end, we used Inheritance to reuse code from the Vehicle class, then we used Polymorphism to call the methods with different implementations from different objects in a transparent way, and Method Overriding gave us the flexibility to adapt only the method we wanted in motorcycle while keeping the default behavior that truck inherited from Vehicle.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is the 4th article in a series on Object-Oriented Programming: Classes and Objects in Python Object-Oriented Programming: Encapsulation in Python Inheritance in Python Object-Oriented Programming: Polymorphism in Python Read the article about Inheritance before diving into this one. Say we want a motorcycle class, we don&#8217;t have to worry about cargo since that&#8217;s a [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":1995,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[6],"class_list":["post-1994","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-python"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":6}},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Object-Oriented Programming: Polymorphism in Python<\/title>\n<meta name=\"description\" content=\"Learn one of the most important concepts of object-oriented programming, Polymorphism, in Python,\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/renanmf.com\/object-oriented-programming-polymorphism-in-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Object-Oriented Programming: Polymorphism in Python\" \/>\n<meta property=\"og:description\" content=\"Learn one of the most important concepts of object-oriented programming, Polymorphism, in Python,\" \/>\n<meta property=\"og:url\" content=\"https:\/\/renanmf.com\/object-oriented-programming-polymorphism-in-python\/\" \/>\n<meta property=\"og:site_name\" content=\"Renan Moura - Software Engineering\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/renanmouraf\" \/>\n<meta property=\"article:published_time\" content=\"2020-09-02T11:14:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-12-29T13:21:01+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/renanmf.com\/wp-content\/uploads\/2020\/09\/image.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Renan Moura\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/renanmouraf\" \/>\n<meta name=\"twitter:site\" content=\"@renanmouraf\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Renan Moura\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/renanmf.com\\\/object-oriented-programming-polymorphism-in-python\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/renanmf.com\\\/object-oriented-programming-polymorphism-in-python\\\/\"},\"author\":{\"name\":\"Renan Moura\",\"@id\":\"https:\\\/\\\/renanmf.com\\\/#\\\/schema\\\/person\\\/1a6fd46256318d200c1c8a867448e5a8\"},\"headline\":\"Object-Oriented Programming: Polymorphism in Python\",\"datePublished\":\"2020-09-02T11:14:36+00:00\",\"dateModified\":\"2020-12-29T13:21:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/renanmf.com\\\/object-oriented-programming-polymorphism-in-python\\\/\"},\"wordCount\":474,\"publisher\":{\"@id\":\"https:\\\/\\\/renanmf.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/renanmf.com\\\/object-oriented-programming-polymorphism-in-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/renanmf.com\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/image.png\",\"keywords\":[\"python\"],\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/renanmf.com\\\/object-oriented-programming-polymorphism-in-python\\\/\",\"url\":\"https:\\\/\\\/renanmf.com\\\/object-oriented-programming-polymorphism-in-python\\\/\",\"name\":\"Object-Oriented Programming: Polymorphism in Python\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/renanmf.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/renanmf.com\\\/object-oriented-programming-polymorphism-in-python\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/renanmf.com\\\/object-oriented-programming-polymorphism-in-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/renanmf.com\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/image.png\",\"datePublished\":\"2020-09-02T11:14:36+00:00\",\"dateModified\":\"2020-12-29T13:21:01+00:00\",\"description\":\"Learn one of the most important concepts of object-oriented programming, Polymorphism, in Python,\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/renanmf.com\\\/object-oriented-programming-polymorphism-in-python\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/renanmf.com\\\/object-oriented-programming-polymorphism-in-python\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/renanmf.com\\\/object-oriented-programming-polymorphism-in-python\\\/#primaryimage\",\"url\":\"https:\\\/\\\/renanmf.com\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/image.png\",\"contentUrl\":\"https:\\\/\\\/renanmf.com\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/image.png\",\"width\":1200,\"height\":630,\"caption\":\"polymorphism\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/renanmf.com\\\/object-oriented-programming-polymorphism-in-python\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"In\u00edcio\",\"item\":\"https:\\\/\\\/renanmf.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Object-Oriented Programming: Polymorphism in Python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/renanmf.com\\\/#website\",\"url\":\"https:\\\/\\\/renanmf.com\\\/\",\"name\":\"Renan Moura - Software Engineering\",\"description\":\"Software development, machine learning\",\"publisher\":{\"@id\":\"https:\\\/\\\/renanmf.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/renanmf.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/renanmf.com\\\/#organization\",\"name\":\"Renan Moura\",\"url\":\"https:\\\/\\\/renanmf.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/renanmf.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/renanmf.com\\\/wp-content\\\/uploads\\\/2020\\\/03\\\/me-e1583179172701.jpeg\",\"contentUrl\":\"https:\\\/\\\/renanmf.com\\\/wp-content\\\/uploads\\\/2020\\\/03\\\/me-e1583179172701.jpeg\",\"width\":120,\"height\":120,\"caption\":\"Renan Moura\"},\"image\":{\"@id\":\"https:\\\/\\\/renanmf.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/renanmouraf\",\"https:\\\/\\\/x.com\\\/renanmouraf\",\"https:\\\/\\\/instagram.com\\\/renanmouraf\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/renanmouraf\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/renanmf.com\\\/#\\\/schema\\\/person\\\/1a6fd46256318d200c1c8a867448e5a8\",\"name\":\"Renan Moura\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/efb78bdd04aa5627f80307aed5a9b31989d901c536d1e014a29a3c3591338af8?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/efb78bdd04aa5627f80307aed5a9b31989d901c536d1e014a29a3c3591338af8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/efb78bdd04aa5627f80307aed5a9b31989d901c536d1e014a29a3c3591338af8?s=96&d=mm&r=g\",\"caption\":\"Renan Moura\"},\"description\":\"I'm a Software Engineer working in the industry for a decade now. I like to solve problems with as little code as possible. I\u2019m interested in solving all sorts of problems with technology in creative and innovative ways. From everyday shell scripts to machine learning models. I write about Software Development, Machine Learning, and Career in tech.\",\"sameAs\":[\"https:\\\/\\\/renanmf.com\\\/\",\"https:\\\/\\\/www.instagram.com\\\/renanmouraf\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/renanmouraf\\\/\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/renanmouraf\"],\"url\":\"https:\\\/\\\/renanmf.com\\\/author\\\/renanmoura\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Object-Oriented Programming: Polymorphism in Python","description":"Learn one of the most important concepts of object-oriented programming, Polymorphism, in Python,","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:\/\/renanmf.com\/object-oriented-programming-polymorphism-in-python\/","og_locale":"en_US","og_type":"article","og_title":"Object-Oriented Programming: Polymorphism in Python","og_description":"Learn one of the most important concepts of object-oriented programming, Polymorphism, in Python,","og_url":"https:\/\/renanmf.com\/object-oriented-programming-polymorphism-in-python\/","og_site_name":"Renan Moura - Software Engineering","article_publisher":"https:\/\/www.facebook.com\/renanmouraf","article_published_time":"2020-09-02T11:14:36+00:00","article_modified_time":"2020-12-29T13:21:01+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/renanmf.com\/wp-content\/uploads\/2020\/09\/image.png","type":"image\/png"}],"author":"Renan Moura","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/renanmouraf","twitter_site":"@renanmouraf","twitter_misc":{"Written by":"Renan Moura","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/renanmf.com\/object-oriented-programming-polymorphism-in-python\/#article","isPartOf":{"@id":"https:\/\/renanmf.com\/object-oriented-programming-polymorphism-in-python\/"},"author":{"name":"Renan Moura","@id":"https:\/\/renanmf.com\/#\/schema\/person\/1a6fd46256318d200c1c8a867448e5a8"},"headline":"Object-Oriented Programming: Polymorphism in Python","datePublished":"2020-09-02T11:14:36+00:00","dateModified":"2020-12-29T13:21:01+00:00","mainEntityOfPage":{"@id":"https:\/\/renanmf.com\/object-oriented-programming-polymorphism-in-python\/"},"wordCount":474,"publisher":{"@id":"https:\/\/renanmf.com\/#organization"},"image":{"@id":"https:\/\/renanmf.com\/object-oriented-programming-polymorphism-in-python\/#primaryimage"},"thumbnailUrl":"https:\/\/renanmf.com\/wp-content\/uploads\/2020\/09\/image.png","keywords":["python"],"articleSection":["Python"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/renanmf.com\/object-oriented-programming-polymorphism-in-python\/","url":"https:\/\/renanmf.com\/object-oriented-programming-polymorphism-in-python\/","name":"Object-Oriented Programming: Polymorphism in Python","isPartOf":{"@id":"https:\/\/renanmf.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/renanmf.com\/object-oriented-programming-polymorphism-in-python\/#primaryimage"},"image":{"@id":"https:\/\/renanmf.com\/object-oriented-programming-polymorphism-in-python\/#primaryimage"},"thumbnailUrl":"https:\/\/renanmf.com\/wp-content\/uploads\/2020\/09\/image.png","datePublished":"2020-09-02T11:14:36+00:00","dateModified":"2020-12-29T13:21:01+00:00","description":"Learn one of the most important concepts of object-oriented programming, Polymorphism, in Python,","breadcrumb":{"@id":"https:\/\/renanmf.com\/object-oriented-programming-polymorphism-in-python\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/renanmf.com\/object-oriented-programming-polymorphism-in-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/renanmf.com\/object-oriented-programming-polymorphism-in-python\/#primaryimage","url":"https:\/\/renanmf.com\/wp-content\/uploads\/2020\/09\/image.png","contentUrl":"https:\/\/renanmf.com\/wp-content\/uploads\/2020\/09\/image.png","width":1200,"height":630,"caption":"polymorphism"},{"@type":"BreadcrumbList","@id":"https:\/\/renanmf.com\/object-oriented-programming-polymorphism-in-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"In\u00edcio","item":"https:\/\/renanmf.com\/"},{"@type":"ListItem","position":2,"name":"Object-Oriented Programming: Polymorphism in Python"}]},{"@type":"WebSite","@id":"https:\/\/renanmf.com\/#website","url":"https:\/\/renanmf.com\/","name":"Renan Moura - Software Engineering","description":"Software development, machine learning","publisher":{"@id":"https:\/\/renanmf.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/renanmf.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/renanmf.com\/#organization","name":"Renan Moura","url":"https:\/\/renanmf.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/renanmf.com\/#\/schema\/logo\/image\/","url":"https:\/\/renanmf.com\/wp-content\/uploads\/2020\/03\/me-e1583179172701.jpeg","contentUrl":"https:\/\/renanmf.com\/wp-content\/uploads\/2020\/03\/me-e1583179172701.jpeg","width":120,"height":120,"caption":"Renan Moura"},"image":{"@id":"https:\/\/renanmf.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/renanmouraf","https:\/\/x.com\/renanmouraf","https:\/\/instagram.com\/renanmouraf","https:\/\/www.linkedin.com\/in\/renanmouraf\/"]},{"@type":"Person","@id":"https:\/\/renanmf.com\/#\/schema\/person\/1a6fd46256318d200c1c8a867448e5a8","name":"Renan Moura","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/efb78bdd04aa5627f80307aed5a9b31989d901c536d1e014a29a3c3591338af8?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/efb78bdd04aa5627f80307aed5a9b31989d901c536d1e014a29a3c3591338af8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/efb78bdd04aa5627f80307aed5a9b31989d901c536d1e014a29a3c3591338af8?s=96&d=mm&r=g","caption":"Renan Moura"},"description":"I'm a Software Engineer working in the industry for a decade now. I like to solve problems with as little code as possible. I\u2019m interested in solving all sorts of problems with technology in creative and innovative ways. From everyday shell scripts to machine learning models. I write about Software Development, Machine Learning, and Career in tech.","sameAs":["https:\/\/renanmf.com\/","https:\/\/www.instagram.com\/renanmouraf\/","https:\/\/www.linkedin.com\/in\/renanmouraf\/","https:\/\/x.com\/https:\/\/twitter.com\/renanmouraf"],"url":"https:\/\/renanmf.com\/author\/renanmoura\/"}]}},"_links":{"self":[{"href":"https:\/\/renanmf.com\/wp-json\/wp\/v2\/posts\/1994","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/renanmf.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/renanmf.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/renanmf.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/renanmf.com\/wp-json\/wp\/v2\/comments?post=1994"}],"version-history":[{"count":7,"href":"https:\/\/renanmf.com\/wp-json\/wp\/v2\/posts\/1994\/revisions"}],"predecessor-version":[{"id":2571,"href":"https:\/\/renanmf.com\/wp-json\/wp\/v2\/posts\/1994\/revisions\/2571"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/renanmf.com\/wp-json\/wp\/v2\/media\/1995"}],"wp:attachment":[{"href":"https:\/\/renanmf.com\/wp-json\/wp\/v2\/media?parent=1994"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/renanmf.com\/wp-json\/wp\/v2\/categories?post=1994"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/renanmf.com\/wp-json\/wp\/v2\/tags?post=1994"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}