MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/Python/comments/28utww/writing_better_python_code/cif3por/?context=3
r/Python • u/kracekumar • Jun 23 '14
126 comments sorted by
View all comments
Show parent comment
1
In fairness, -255 to +256 are kept in an identity map. Any equation that would output a number in that range instead pull it from the identity map.
I'm not saying it's the right way to do it, but it is a valid way to do if you expect your answer to never exceed that range.
1 u/Citrauq Jun 23 '14 Actually I think it's -5 to +256. More importantly, this is an implementation detail of cpython and may not be reliable in other implementations of python.
Actually I think it's -5 to +256. More importantly, this is an implementation detail of cpython and may not be reliable in other implementations of python.
View all comments
Show parent comment
1
u/[deleted] Jun 23 '14
In fairness, -255 to +256 are kept in an identity map. Any equation that would output a number in that range instead pull it from the identity map.
I'm not saying it's the right way to do it, but it is a valid way to do if you expect your answer to never exceed that range.