title: How to hide method of base class from being acessed by object of child class?
body: <p>How can i stop x(an object of child class)  from acessing the method  show_catalogue() , of base class?
  I want to make a base class , to store all the bike objects which are available for rent , and then want to make this catalogue an attribute of another class Rentshop? Is the way i am doing it is correct?</p>
  <pre><code>
  import pandas as pd
  import time
  import numpy as np
  
  
  class bike_shop:
  
  
      bike_list = [
          {
              &quot;ID&quot;: 1,
              &quot;BikeName&quot;: &quot;Bajaj CT 100&quot;,
              &quot;Rent_hour&quot;: 139,
              &quot;Rent_Weekly&quot;: 599,
              &quot;Rent_Monthly&quot;: 3339
          },
          {
              &quot;ID&quot;: 2,
              &quot;BikeName&quot;: &quot;Bajaj CT 100&quot;,
              &quot;Rent_hour&quot;: 139,
              &quot;Rent_Weekly&quot;: 599,
              &quot;Rent_Monthly&quot;: 3339
          },
          {
              &quot;ID&quot;: 3,
              &quot;BikeName&quot;: &quot;Bajaj CT 100&quot;,
              &quot;Rent_hour&quot;: 139,
              &quot;Rent_Weekly&quot;: 599,
              &quot;Rent_Monthly&quot;: 3339
          },
          {
              &quot;ID&quot;: 4,
              &quot;BikeName&quot;: &quot;Bajaj CT 100&quot;,
              &quot;Rent_hour&quot;: 139,
              &quot;Rent_Weekly&quot;: 599,
              &quot;Rent_Monthly&quot;: 3339
          },
          {
              &quot;ID&quot;: 5,
              &quot;BikeName&quot;: &quot;Bajaj CT 100&quot;,
              &quot;Rent_hour&quot;: 139,
              &quot;Rent_Weekly&quot;: 599,
              &quot;Rent_Monthly&quot;: 3339
          }
      ]
  
  
      def show_catalogue(self):
          df = pd.DataFrame(bike_shop.bike_list)
          return df
  
  
  
  
  
  class Rentshop(bike_shop):
      def __init__(self):
          self.catalogue = bike_shop.show_catalogue(self)
  
  
  x = Rentshop()
  print(x.catalogue)
  
  print(x.show_catalogue())
  
  </code></pre>