Sebastian Hagen <sh_pyb...@memespace.net> added the comment: I've glanced at some of the other PyByteArray_AS_STRING() (and PyByteArray_AsStr(), which inherits this behaviour) uses in the stdlib. By far the heaviest user is bytearrayobject.c; aside from that, there's by my count only 24 uses in current trunk. I haven't looked at all of them in detail, but the ones I have looked at all seem to ensure that the possible NULL retvals don't cause them problems.
Given that, and considering that bytearray itself uses it for all kinds of operations, I'd be rather reluctant to add any additional overhead to this macro absent some authoritative statement that the current behaviour is bad. We'd definitely get better performance by just having posixmodule.c pay attention to the retval it gets. [Yes, this is probably premature optimization; but it's not as if fixing posixmodule.c takes any massive changes either, so I'm not too worried about additional code complexity in this particular case.] ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue7561> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com