Why is it the same to view multiple methods id defined in a class in Python?

three methods, _ _ init__, name and add, are defined in the Myclass class, and the object is instantiated as C1. When you look at the id of the three methods, you find that they are the same. Why?
class Myclass (object):

def __init__(self, x):
    self.x = x

def name(self):
    print self.x

def add(self):
    self.x+"world"
    print self.x

 

C1 = Myclass ("hello")

print id (C1)
print id (c1.The initableness _)
print id (c1.name)
print id (c1.add)

output is
44030704
43882136

Mar.04,2021

this is because Python reuses the same memory address. After you point to id (c1.roomroominitarians _) , c1.roominitarians _ is no longer referenced and will be recycled, and then execute id (c1.name) when c1.name reuses the memory address that was just used c1.roominitableness _ , the following c1.add is the same.

there is a sentence in the introduction to the id () function in the Python document:

Two objects with non-overlapping lifetimes may have the same id () value

means that two objects whose lifecycles do not overlap are

that may have the same id.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b36e97-2c033.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b36e97-2c033.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?