Larry Hastings added the comment:

A quick note about the extension mechanism.  Currently the only way to extend 
PyArg_Parse* is via O&.  Therefore, any extended type you add will use O&, and 
will have a "converter".  So internally all I did was say "if the parameter has 
a converter, ignore the type and use the O& format unit".

This may not be the perfect extension API, if we change Clinic to using some 
new yet-to-be-defined API for argument parsing.  But I suspect it's pretty 
close.  Extension types will need a conversion function from PyObject to their 
type, they'll need a way of defining the C default value, and they'll need a 
way of cleaning up afterwards, all of which I already do.  So I guess I'm 
interested in feedback on the extension API too.

----------

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

Reply via email to