Created originally on Bitbucket by ashwinahuja (Ashwin Ahuja)
Encountered lots of problems in an old C extension I was trying to get working with PyPy, to do with missing things inside datetime.h (and cpyext_datetime.h).
Idea is to bring everything a bit closer to: https://github.com/python/cpython/blob/master/Include/datetime.h
Included in this is 'long hashcode' in:
Also added 'unsigned char fold' (+ new constructors that let this be used) to:
And: 'unsigned char data[...]' to:
Finally, added the objects:
Also brought across DATETIME_API_MAGIC which is a part of CPython and I found I had a reliance on (therefore others might have the same thing)