Roundup Robot added the comment:
New changeset 41fb7fd04b5d by Larry Hastings in branch 'default':
Issue #24001: Argument Clinic converters now use accept={type}
https://hg.python.org/cpython/rev/41fb7fd04b5d
--
nosy: +python-dev
___
Python tracker
Changes by Larry Hastings la...@hastings.org:
--
resolution: - fixed
stage: patch review - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24001
___
Serhiy Storchaka added the comment:
Usually converters are named by the C type of the result. May be rename the
str converter to pchar?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24001
Larry Hastings added the comment:
Attached is a patch implementing all my proposed changes here:
* types is now renamed accept
* it accepts a set of real Python types
* there are placeholder types for buffer, robuffer, rwbuffer
* nullable=True is gone, replaced with adding NoneType to accept={}
Serhiy Storchaka added the comment:
Looks as this is a patch for different issue.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24001
___
___
Larry Hastings added the comment:
Here's the right patch.
--
Added file: http://bugs.python.org/file39128/larry.clinic.use.raw.types.2.txt
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24001
Changes by Larry Hastings la...@hastings.org:
Removed file:
http://bugs.python.org/file39122/larry.one.more.clinic.format.unit.map.cleanup.2.txt
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24001
Larry Hastings added the comment:
Whoops. I'll fix that.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24001
___
___
Python-bugs-list mailing
Larry Hastings added the comment:
Thanks to #24002 I now know how to write evalify_node properly. This revision
of the patch is much better, and maybe ready for checkin.
--
Added file:
http://bugs.python.org/file39122/larry.one.more.clinic.format.unit.map.cleanup.2.txt
New submission from Larry Hastings:
New proposed semantics for the types= parameter to converters: where possible,
pass in actual types. The resulting syntax:
c: int(types={str}) # maps to 'U'
s: str(types={str, robuffer}, length=True, zeroes=True) # maps to 's#'
Since buffer, robuffer,
Larry Hastings added the comment:
Should types= be renamed accept= ? It's a set of the types of the Python
objects that this parameter should accept.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24001
Larry Hastings added the comment:
I should mention that evalify_node() is pretty hacked up here, and is not ready
to be checked in. (I'm proposing separately that we simply add something like
this directly into the standard library, see issue #24002.)
--
Serhiy Storchaka added the comment:
accept= (or accept_types=) LGTM.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24001
___
___
13 matches
Mail list logo