| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Use it for the mode arguments in filemode(), S_IMODE(), S_ISDIR(), etc.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
| value = PyLong_AsUnsignedLong(op); | ||
| if ((value == (unsigned long)-1) && PyErr_Occurred()) | ||
| if (PyLong_Check(op)) { | ||
| value = PyLong_AsUnsignedLong(op); |
There was a problem hiding this comment.
This code path looks like a micro-optimization (to avoid PyNumber_Index). I don't think that it's worth it.
Sorry, something went wrong.
There was a problem hiding this comment.
Not only. Many functions like PyLong_AsUnsignedLong() and PyLong_AsUnsignedLongMask(), many setters and converter, only call __index__() if the argument not int. So there would be a subtle behavior difference when the argument is an instance of the int subclass which defines __index__(). And calling __index__() for int subclass adds overhead.
But this is not completely consistent, so this may not make large difference.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Use it for the mode arguments in filemode(), S_IMODE(), S_ISDIR(), etc.