Feb-02-2019, 04:40 PM
Your code doesn't test what you are asking about. You are asking about the same method of two different instances. You are testing two different methods of the same instance.
That said, I'm not sure what is going on with your results. The id of an object should be unique to that object and constant over it's lifespan. That two methods of the same instance have the same id means either they're the same object or their lifespans do not overlap.
I assigned the methods to other variables, and got different id's. That seems to imply that bound methods are created as needed. If you create one just for an id check, that id is freed up after the id check because the as-needed bound method goes away. That id is then reused for the second id check. However if you save the as-need bound method with a variable, a new id has to be picked for it.
I don't know for sure, that's just guessing based on the observed behavior.
Note that if you separately store the same method of the same instance in two different variables, they have different ids.
That said, I'm not sure what is going on with your results. The id of an object should be unique to that object and constant over it's lifespan. That two methods of the same instance have the same id means either they're the same object or their lifespans do not overlap.
I assigned the methods to other variables, and got different id's. That seems to imply that bound methods are created as needed. If you create one just for an id check, that id is freed up after the id check because the as-needed bound method goes away. That id is then reused for the second id check. However if you save the as-need bound method with a variable, a new id has to be picked for it.
I don't know for sure, that's just guessing based on the observed behavior.
Note that if you separately store the same method of the same instance in two different variables, they have different ids.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures