Mar-01-2019, 11:57 AM
Hi,
Typically aliasing is done by assigning the 'original' variable to some other variable. But I was exploring the intricacies of aliasing, and am wondering what might explain the following phenomenon:
Typically aliasing is done by assigning the 'original' variable to some other variable. But I was exploring the intricacies of aliasing, and am wondering what might explain the following phenomenon:
>>> x = 5 >>> y = 5 >>> id(x) == id(y) True >>> x = 'hi' >>> y = 'hi' >>> id(x) == id(y) True >>> x = [1] >>> y = [1] >>> id(x) == id(y) FalseThanks