Message171578
Actually, I think it'll be messy to make this work: PyType_GetFlags is part of the stable ABI, so that's got to continue to return a long rather than an unsigned long. And then we've got, in object.h:
#ifdef Py_LIMITED_API
#define PyType_HasFeature(t,f) ((PyType_GetFlags(t) & (f)) != 0)
#else
#define PyType_HasFeature(t,f) (((t)->tp_flags & (f)) != 0)
#endif
So we'd need an extra cast from long to unsigned long in the first branch.
I suggest instead just replacing that one occurrence of (1L << 31) with (long)(1UL << 31) to get around the undefined behaviour.
P.S. The docs would also need to be updated in these two files:
Doc/c-api/typeobj.rst
Doc/includes/typestruct.h |
|
Date |
User |
Action |
Args |
2012-09-29 17:14:01 | mark.dickinson | set | recipients:
+ mark.dickinson, vstinner, ezio.melotti |
2012-09-29 17:14:01 | mark.dickinson | set | messageid: <1348938841.63.0.341405579516.issue16086@psf.upfronthosting.co.za> |
2012-09-29 17:14:01 | mark.dickinson | link | issue16086 messages |
2012-09-29 17:14:00 | mark.dickinson | create | |
|