Steve Dower <steve.do...@python.org> added the comment:

Typically, as soon as I merge, I spot an edge case issue.

PySys_Audit(n, "O", a) is deliberately going to treat 'a' as the tuple of 
arguments (when it is a tuple). This lets us simplify/optimise events where the 
event arguments match the function arguments exactly. If 'a' is not a tuple, it 
gets wrapped in one.

When 'a' is meant to be a single argument that _might_ be a tuple, such as in 
PyObj_FromPtr, the format string needs to be "(O)" to ensure it is treated as a 
one element tuple. This is just how Py_BuildValue works - multiple elements 
become a tuple and the parens are optional unless you want a one-element tuple.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue38622>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to