Hi,
Platform: Windows 10
Python version: 3.7
I came across a video on YouTube which suggested that objects
in Python get their own copies of the class methods.
If this is true then programs in Python must use a lot of memory.
The code below was an attempt to print the ids of the two methods.
The result was that both methods had the same id.
Would appreciate some clarification on this issue.
Thanks in advance for any help.
Platform: Windows 10
Python version: 3.7
I came across a video on YouTube which suggested that objects
in Python get their own copies of the class methods.
If this is true then programs in Python must use a lot of memory.
The code below was an attempt to print the ids of the two methods.
The result was that both methods had the same id.
Would appreciate some clarification on this issue.
Thanks in advance for any help.
class Testing: def print_me(self): print(id(self.print_me)) def print_me2(self): print(id(self.print_me2)) myTest = Testing() myTest.print_me() myTest.print_me2()