Quote:Why do want to do this?.
It also break over integer 256.
>>> divyansh = 2222
>>> jhon = 2222
>>> id(divyansh)
2362812091760
>>> id(jhon)
2362812091920
>>> id(2222)
2362812088752
Then it step out small integer optimization between -5 and 256.
actually i am doing this because i want to pass two variables to max() function and what ever is greater i want to have the name printed of that variable and the value of that variable,
ex- divyansh is the name of the person and 22 is the age
jhon is the name of the person and 21 is the age
so i want to have the name and the age of the person printed
so i did-->
divyansh=22
jhon =21
determine_the_name=max(divyansh,jhon)
# but here determine_the_name will have 22 not the variable name divyansh
# so i taught that id of 22 will be same and if any how i can know the references of that id then it will lead to the variable name somehow
i know i can do this very easily through if-else ladder but i don't want to go that way,
and as we know this concept of referring works in decorators so i thought there can be a similar way to approach this
# in decorators we can get the real wrapper function name by using __name__ method onto the decorated method as
print(decorated_function.__name__) # will return the name of the actual function which is responsible the functionality of decorated_function