{"id":87,"date":"2007-09-06T01:37:00","date_gmt":"2007-09-06T01:37:00","guid":{"rendered":"http:\/\/grummfy.be\/blog\/?p=87"},"modified":"2007-09-06T01:37:00","modified_gmt":"2007-09-06T01:37:00","slug":"python-lheritage-en-quelques-lignes","status":"publish","type":"post","link":"https:\/\/grummfy.be\/blog\/87","title":{"rendered":"Python, l&rsquo;h\u00e9ritage en quelques lignes"},"content":{"rendered":"<p>Python, l&rsquo;h\u00e9ritage en quelques lignes<\/p>\n<pre> # !\/usr\/bin\/python # -*- coding: UTF-8 -*- class A():     def A(self):         print self.C() + '.A'     def B(self):         print self.C() + '.B'     def C(self):         return 'A' class B(A):     def B(self):         self.A()         A.A(self)         A.B(self)     def C(self):         return 'B' print 'test de A' a = A() a.B() print ' test de B' b = B() b.B() <\/pre>\n<p>r\u00e9sultat affich\u00e9&nbsp;:<\/p>\n<blockquote>\n<p>test de A A.B<\/p>\n<p> test de B B.A B.A B.B<\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Python, l&rsquo;h\u00e9ritage en quelques lignes # !\/usr\/bin\/python # -*- coding: UTF-8 -*- class A(): def A(self): print self.C() + &lsquo;.A&rsquo; def B(self): print self.C() + &lsquo;.B&rsquo; def C(self): return &lsquo;A&rsquo; class B(A): def B(self): self.A() A.A(self) A.B(self) def C(self): return &lsquo;B&rsquo; print &lsquo;test de A&rsquo; a = A() a.B() print &lsquo; test de B&rsquo; b [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"webmentions_disabled_pings":false,"webmentions_disabled":false,"footnotes":""},"categories":[9],"tags":[22,24,70,28],"class_list":["post-87","post","type-post","status-publish","format-standard","hentry","category-dev","tag-jouons","tag-programmation","tag-python","tag-trucs-et-astuces"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/grummfy.be\/blog\/wp-json\/wp\/v2\/posts\/87","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/grummfy.be\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/grummfy.be\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/grummfy.be\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/grummfy.be\/blog\/wp-json\/wp\/v2\/comments?post=87"}],"version-history":[{"count":0,"href":"https:\/\/grummfy.be\/blog\/wp-json\/wp\/v2\/posts\/87\/revisions"}],"wp:attachment":[{"href":"https:\/\/grummfy.be\/blog\/wp-json\/wp\/v2\/media?parent=87"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/grummfy.be\/blog\/wp-json\/wp\/v2\/categories?post=87"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/grummfy.be\/blog\/wp-json\/wp\/v2\/tags?post=87"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}