[issue20141] Argument Clinic: broken support for 'O!'

2014-01-07 Thread Larry Hastings
Larry Hastings added the comment: Argument Clinic's support for "O!" is now simpler and more flexible. It's not as convenient as the previous API, but that API wasn't really sustainable. I'm assuming this fixes your problem; if not please open a new issue. -- resolution: -> fixed st

[issue20141] Argument Clinic: broken support for 'O!'

2014-01-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset ddb5cd3e0860 by Larry Hastings in branch 'default': Issue #20141: Improved Argument Clinic's support for the PyArg_Parse "O!" http://hg.python.org/cpython/rev/ddb5cd3e0860 -- nosy: +python-dev ___ Python

[issue20141] Argument Clinic: broken support for 'O!'

2014-01-07 Thread Larry Hastings
Larry Hastings added the comment: There are lots of ways you can crash Python by giving erroneous input to Argument Clinic. Clinic has no visibility into the C type system, so it has no way of verifying whether or not the type objects you pass in are correct. That's unfixable and not really

[issue20141] Argument Clinic: broken support for 'O!'

2014-01-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is marked "crash" because Argument Clinic generates code which crashes. It is assigned to docs because this feature documentation is misleading. -- ___ Python tracker ___

[issue20141] Argument Clinic: broken support for 'O!'

2014-01-07 Thread Larry Hastings
Larry Hastings added the comment: Attached is a new, simpler approach for supporting O!. The object() converter now takes two arguments: * type, which is the type you want the parameter declared as (e.g. "PyUnicodeObject *") * subclass_of, which is the PyTypeObject you want to enforce t

[issue20141] Argument Clinic: broken support for 'O!'

2014-01-06 Thread Larry Hastings
Larry Hastings added the comment: Actually, the documentation (the "howto") states: Note that object() must explicitly support each Python type you specify for the type argument. Currently it only supports str. It should be easy to add more, just edit Tools/clinic/clinic.py, search for O! in t

[issue20141] Argument Clinic: broken support for 'O!'

2014-01-06 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Added file: http://bugs.python.org/file33325/spammodule.c ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue20141] Argument Clinic: broken support for 'O!'

2014-01-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: You can't manually specify "&" at the front of the name. -- ___ Python tracker ___ ___ Python-bugs

[issue20141] Argument Clinic: broken support for 'O!'

2014-01-06 Thread Larry Hastings
Larry Hastings added the comment: So a documentation error and having to manually specify "&" at the front of your string means it's "broken"? Nevertheless, I'll take a look at it. -- ___ Python tracker _

[issue20141] Argument Clinic: broken support for 'O!'

2014-01-06 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: First, the documentation says that syntax for 'O!' conversion is object(type='name_of_Python_type'), but actually the type argument should be the name of C structure which represents Python type. I.e. object(type='list') is rejected, and object(type='PyList