> Quick and obvious fix: > > static PyObject * > nu_bool(const char *p, const formatdef *f) > { > char x; > memcpy((char *)&x, p, sizeof x); > return PyBool_FromLong(x != 0); > }
Which is optimized to static PyObject * nu_bool(const char *p, const formatdef *f) { return PyBool_FromLong(*p != 0); } _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/L6F66QMZHEG3TOIC2ERDFDUXHRSITUMZ/ Code of Conduct: http://python.org/psf/codeofconduct/