classification
Title: PyOS_InputHook() and related API funcs. not documented
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: ajaksu2, akuchling, belopolsky, docs@python, eric.araujo, ezio.melotti, georg.brandl, python-dev, terry.reedy
Priority: normal Keywords:

Created on 2006-09-07 14:06 by akuchling, last changed 2013-05-29 01:50 by akuchling. This issue is now closed.

Files
File name Uploaded Description Edit
inputhook.txt akuchling, 2013-05-24 20:35 review
Messages (8)
msg60996 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2006-09-07 14:06
AFAICT, PyOS_InputHook() isn't described anywhere in
the docs.  Even the .h files don't contain comments
explaining it.
msg84470 - (view) Author: Daniel Diniz (ajaksu2) (Python triager) Date: 2009-03-30 03:08
The only mention I can find is in Misc/HISTORY:
    When the interpreter shell is invoked interactively, it attempts
    to import the readline module; when this fails, the default input
    mechanism is used.  The hook variables are PyOS_InputHook and
    PyOS_ReadlineFunctionPointer.
msg130402 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2011-03-09 02:42
A.B, I believe you have looked at other areas of missing C-API docs. What do you think of this one? Is it still missing?
msg189929 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2013-05-24 20:35
Here's a proposed patch to the c-api manual that describes these two pointers.  I put them in the 'very high-level API' section. Maybe they belong in the Operating System Utilities section instead, but I think they're intertwined with the interpreter loop and therefore belong in the 'very high-level' section.
msg189930 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2013-05-24 20:46
I am not a C-api user, but the entries are pretty clear to me and seem ready to apply. The usage examples are a nice touch. OS Utilites is not where I would expect interpreter loop hooks, so I think the current location is better.
msg189932 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2013-05-24 21:20
One question about the patch: how to give the prototype expected for the function?  I currently have it as:

char *(*PyOS_ReadlineFunctionPointer)(FILE *stdin, FILE *stdout, char *prompt)

Would it be better with a trivial function name, as in:

char *func(FILE *stdin, FILE *stdout, char *prompt)
msg189936 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2013-05-24 22:27
Can one of you three answer Kuchling's question about formatting a data entry that consists of a function pointer with function signature?
msg190262 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-05-29 01:48
New changeset 672614d809a1 by Andrew Kuchling in branch 'default':
#1554133: Document PyOS_InputHook, PyOS_ReadlineFunctionPointer
http://hg.python.org/cpython/rev/672614d809a1
History
Date User Action Args
2013-05-29 01:50:33akuchlingsetstatus: open -> closed
stage: commit review -> resolved
resolution: fixed
versions: - Python 2.7, Python 3.3
2013-05-29 01:48:44python-devsetnosy: + python-dev
messages: + msg190262
2013-05-24 22:27:32terry.reedysetnosy: + georg.brandl, ezio.melotti, eric.araujo
messages: + msg189936
2013-05-24 21:20:22akuchlingsetmessages: + msg189932
2013-05-24 20:46:40terry.reedysetstage: commit review
messages: + msg189930
versions: + Python 3.4, - Python 3.1, Python 3.2
2013-05-24 20:35:39akuchlingsetfiles: + inputhook.txt

messages: + msg189929
2011-03-09 02:42:33terry.reedysetnosy: + terry.reedy, belopolsky

messages: + msg130402
versions: + Python 3.3
2010-08-24 20:31:22BreamoreBoysetassignee: docs@python

nosy: + docs@python
2010-08-07 18:33:08terry.reedysetversions: - Python 2.6
2010-07-10 06:25:32terry.reedysetversions: + Python 3.1, Python 2.7, Python 3.2
2009-03-30 03:08:05ajaksu2settype: enhancement

messages: + msg84470
nosy: + ajaksu2
2006-09-07 14:06:51akuchlingcreate