Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue24001

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:Clinic: use raw types in types= set
Type:enhancementStage:resolved
Components:Argument ClinicVersions:
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To: larryNosy List: larry, python-dev, serhiy.storchaka, zach.ware
Priority:normalKeywords:

Created on2015-04-19 01:06 bylarry, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
larry.clinic.use.raw.types.1.txtlarry,2015-04-19 01:06review
larry.clinic.use.raw.types.2.txtlarry,2015-04-19 19:29review
larry.clinic.use.raw.types.3.txtlarry,2015-04-20 18:03review
Messages (11)
msg241469 -(view)Author: Larry Hastings (larry)*(Python committer)Date: 2015-04-19 01:06
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", and "rwbuffer" are fake pseudotypes, I created empty classes with those names.Serhiy: with this change in place, the types= parameter uses almost the same number of characters as it used to when it was a string.  (The new syntax requires commas between elements, so for two or more types it's slightly longer.)  Yet this makes the types= parameter far more accurate in illustrating what it's supposed to represent.Does this make you happy? :)
msg241476 -(view)Author: Larry Hastings (larry)*(Python committer)Date: 2015-04-19 05:34
Should types= be renamed accept= ?  It's a set of the types of the Python objects that this parameter should accept.
msg241479 -(view)Author: Larry Hastings (larry)*(Python committer)Date: 2015-04-19 05:40
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.)
msg241481 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2015-04-19 05:51
accept= (or accept_types=) LGTM.
msg241532 -(view)Author: Larry Hastings (larry)*(Python committer)Date: 2015-04-19 18:39
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.
msg241535 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2015-04-19 18:48
Looks as this is a patch for different issue.
msg241552 -(view)Author: Larry Hastings (larry)*(Python committer)Date: 2015-04-19 19:28
Whoops.  I'll fix that.
msg241553 -(view)Author: Larry Hastings (larry)*(Python committer)Date: 2015-04-19 19:29
Here's the right patch.
msg241671 -(view)Author: Larry Hastings (larry)*(Python committer)Date: 2015-04-20 18:03
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={}
msg241689 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2015-04-20 22:05
Usually converters are named by the C type of the result. May be rename the "str" converter to "pchar"?
msg242558 -(view)Author: Roundup Robot (python-dev)(Python triager)Date: 2015-05-04 14:00
New changeset41fb7fd04b5d by Larry Hastings in branch 'default':Issue#24001: Argument Clinic converters now use accept={type}https://hg.python.org/cpython/rev/41fb7fd04b5d
History
DateUserActionArgs
2022-04-11 14:58:15adminsetgithub: 68189
2015-05-04 15:04:21larrysetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2015-05-04 14:00:11python-devsetnosy: +python-dev
messages: +msg242558
2015-04-20 22:05:08serhiy.storchakasetmessages: +msg241689
2015-04-20 18:03:57larrysetfiles: +larry.clinic.use.raw.types.3.txt

messages: +msg241671
2015-04-19 19:29:11larrysetfiles: +larry.clinic.use.raw.types.2.txt

messages: +msg241553
2015-04-19 19:28:38larrysetfiles: -larry.one.more.clinic.format.unit.map.cleanup.2.txt
2015-04-19 19:28:31larrysetmessages: +msg241552
2015-04-19 18:48:05serhiy.storchakasetmessages: +msg241535
2015-04-19 18:39:59larrysetfiles: +larry.one.more.clinic.format.unit.map.cleanup.2.txt

messages: +msg241532
2015-04-19 05:51:32serhiy.storchakasetmessages: +msg241481
2015-04-19 05:40:27larrysetmessages: +msg241479
2015-04-19 05:34:54larrysetmessages: +msg241476
2015-04-19 01:06:17larrycreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp