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 the value is an instance of (e.g. "&PyUnicode_Type") The old approach was kind of a lovely idea, but was too complicated, and it would have meant registering any new type (like third-party types). This is less convenient, but simple. And it would lend itself well to making a custom converter if you used it a lot.
I'll write some documentation for it now, but I wanted to post the code so I could get a review. p.s. Why was is marked "crash" and "release blocker"? That's very inaccurate. And assigned to docs? WTH? ---------- assignee: docs@python -> larry nosy: -docs@python priority: release blocker -> normal stage: -> patch review type: crash -> behavior Added file: http://bugs.python.org/file33341/larry.argument.clinic.o-bang.rethink.diff.1.txt _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue20141> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com