Advertisement
Guest User

Untitled

a guest
Mar 21st, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. PyObject* aa = PyLong_FromLong(7L);
  2.  
  3. PyObject* aa = PyLong_FromLong(257L);
  4.  
  5. PyObject* PyLong_FromLong(long v)
  6. Return value: New reference.
  7. Return a new PyLongObject object from v, or NULL on failure.
  8.  
  9. The current implementation keeps an array of integer objects for all integers between -5 and 256, when you create an int in that range you actually just get back a reference to the existing object. So it should be possible to change the value of 1. I suspect the behaviour of Python in this case is undefined. :-)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement