Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue15008

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:PEP 362 "Signature Objects" reference implementation
Type:enhancementStage:resolved
Components:Library (Lib)Versions:Python 3.3
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: Alexandre.Zani, Ramchandra Apte, Yury.Selivanov, benjamin.peterson, brett.cannon, eric.araujo, ezio.melotti, larry, python-dev, yselivanov
Priority:normalKeywords:needs review, patch

Created on2012-06-05 22:06 byYury.Selivanov, last changed2022-04-11 14:57 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
pep362.1.patchYury.Selivanov,2012-06-05 22:06review
pep362.2.patchYury.Selivanov,2012-06-14 02:29review
pep362.3.patchYury.Selivanov,2012-06-15 18:04review
pep362.4.patchYury.Selivanov,2012-06-19 02:27review
pep362.5.patchYury.Selivanov,2012-06-19 17:58review
pep362.6.patchYury.Selivanov,2012-06-19 19:26review
pep362.7.patchYury.Selivanov,2012-06-21 17:15review
pep362.8.patchYury.Selivanov,2012-06-22 20:11review
Repositories containing patches
https://bitbucket.org/1st1/cpython/changesets/tip/branch(%22pep362%22)
Messages (17)
msg162377 -(view)Author: Yury Selivanov (Yury.Selivanov)*Date: 2012-06-05 22:06
This issue will track implementation ofPEP 362 functionality.
msg162388 -(view)Author: Ramchandra Apte (Ramchandra Apte)*Date: 2012-06-06 03:01
Signature and signature are two variable names that differ only in case.To avoid confusion, I recommend one of the names should be changed.
msg162390 -(view)Author: Yury Selivanov (Yury.Selivanov)*Date: 2012-06-06 03:12
Well, 'Signature' class is unlikely to be used very frequently.  So I think it's fine.
msg162393 -(view)Author: Éric Araujo (eric.araujo)*(Python committer)Date: 2012-06-06 03:46
Yes, it seems quite common to me to have a class called Thing and instances named thing.  Unless it makes the code wrap better, using real names like signature instead of for example sig is recommended byPEP 8.
msg162748 -(view)Author: Yury Selivanov (Yury.Selivanov)*Date: 2012-06-14 02:29
Attaching a patch that implements the latest version of the PEP.Quick summary:1. Ditched Signature.name & Signature.qualname2. Added Signature.__eq__ and __ne__3. signature() supports classes, metaclasses, decorated stuff, partials, methods, classmethods, callable objects etc4. signature() does a deepcopy of __signature__ attribute ifthere is one5. No implicit caching anywhere6. Signature.format(...) and Signature.__str__7. Signature.bind_partial
msg162927 -(view)Author: Yury Selivanov (Yury.Selivanov)*Date: 2012-06-15 18:04
Attaching the new version of the patch.Summary:1. 'is_*' family was replaced with 'Parameter.kind'2. 'signature()' function was updated to check for '__wrapped__' attribute in all callables3. 'is_implemented' -> 'implemented'4. Added support for POSITIONAL_ONLY parameters (in 'bind()')
msg162979 -(view)Author: Éric Araujo (eric.araujo)*(Python committer)Date: 2012-06-16 16:52
One small thing: can we find a name for the function that starts with a verb?  It’s the recommended naming style for functions, and would help making a difference between the class and the function.  I also expect people to use “signature” and “sig” for their instances.
msg163133 -(view)Author: Yury Selivanov (Yury.Selivanov)*Date: 2012-06-19 02:27
New version (pep363.4.patch)Summary:1. Removed 'Signature.implemented'2. No more patching built-ins - no issues with shared interpreters3. Removed 'Signature.format()'. If needed we'll reintroduce it in 3.4 (although we still have 'Signature.__str__')4. Signature now implements just __copy__ - creates a shallow copy (__deepcopy__ has been removed, as it wasn't deep)5. Signature.__eq__ fixed to ignore order of keyword-only arguments.Thanks and please review!
msg163134 -(view)Author: Yury Selivanov (Yury.Selivanov)*Date: 2012-06-19 02:29
Eric,I personally prefer simple 'signature()' more than 'get_signature()'.  But I'll ask this question on python-dev on the next PEP update.
msg163197 -(view)Author: Yury Selivanov (Yury.Selivanov)*Date: 2012-06-19 17:58
New patch (pep362.5.patch)Fixed a bug in BoundArguments.args & BoundArguments.kwargs
msg163202 -(view)Author: Ezio Melotti (ezio.melotti)*(Python committer)Date: 2012-06-19 18:38
I left a few comments on rietveld.The '\' is sometimes used where not necessary and the preferred way to write conditions on multiple lines is:(foo == bar and bar == baz and baz == asd)rather thanfoo == bar \    and bar == baz \    and baz == asdHave you measured the coverage of the tests?
msg163203 -(view)Author: Yury Selivanov (Yury.Selivanov)*Date: 2012-06-19 19:26
New patch -pep362.6.patchEzio,I've eliminated almost all '\'.Test coverage is now almost 100%.
msg163352 -(view)Author: Yury Selivanov (Yury.Selivanov)*Date: 2012-06-21 17:15
New patch -pep362.7.patchSummary:1. Signature & Parameter objects are now immutable2. Signature.replace() and Parameter.replace()3. Signature has a new default constructor, whichaccepts parameters list and a return_annotation; anda new 'from_function', which create a Signature objectfor the passed function.4. Parameter.__str__The implementation has 100% test coverage and is stable.Please review.Thanks!
msg163477 -(view)Author: Yury Selivanov (Yury.Selivanov)*Date: 2012-06-22 20:11
New patch -pep362.8.patchOne big change (Guido's request) - No more AttributeErrors on missing Parameter.default of Signature.return_annotation.  They now will be set to Parameter.empty & Signature.empty correspondingly.
msg163500 -(view)Author: Roundup Robot (python-dev)(Python triager)Date: 2012-06-22 22:20
New changesetd892bf410478 by Larry Hastings in branch 'default':Issue#15008: ImplementPEP 362 "Signature Objects".http://hg.python.org/cpython/rev/d892bf410478
msg166431 -(view)Author: Benjamin Peterson (benjamin.peterson)*(Python committer)Date: 2012-07-25 22:33
Are we going to get documentation?
msg166440 -(view)Author: Yury Selivanov (yselivanov)*(Python committer)Date: 2012-07-25 23:22
Benjamin:http://bugs.python.org/issue15151
History
DateUserActionArgs
2022-04-11 14:57:31adminsetgithub: 59213
2012-07-25 23:22:48yselivanovsetnosy: +yselivanov
messages: +msg166440
2012-07-25 22:33:54benjamin.petersonsetnosy: +benjamin.peterson
messages: +msg166431
2012-06-26 02:29:46eric.araujolinkissue8916 superseder
2012-06-22 22:26:05larrysetstage: patch review -> resolved
2012-06-22 22:24:52Yury.Selivanovsetstatus: open -> closed
resolution: fixed
2012-06-22 22:20:13python-devsetnosy: +python-dev
messages: +msg163500
2012-06-22 20:11:40Yury.Selivanovsetfiles: +pep362.8.patch

messages: +msg163477
2012-06-21 17:15:15Yury.Selivanovsetfiles: +pep362.7.patch

messages: +msg163352
2012-06-19 19:26:33Yury.Selivanovsetfiles: +pep362.6.patch

messages: +msg163203
2012-06-19 18:38:34ezio.melottisetnosy: +ezio.melotti
messages: +msg163202
2012-06-19 17:59:04Yury.Selivanovsetfiles: +pep362.5.patch

messages: +msg163197
2012-06-19 02:29:05Yury.Selivanovsetmessages: +msg163134
2012-06-19 02:27:42Yury.Selivanovsetfiles: +pep362.4.patch

messages: +msg163133
2012-06-16 16:52:40eric.araujosetmessages: +msg162979
2012-06-15 18:04:35Yury.Selivanovsetfiles: +pep362.3.patch

messages: +msg162927
2012-06-14 02:29:37Yury.Selivanovsetfiles: +pep362.2.patch

messages: +msg162748
2012-06-06 03:47:00eric.araujosetkeywords: +needs review
title: PEP 362 reference implementation for 3.3 -> PEP 362 "Signature Objects" reference implementation
stage: patch review
2012-06-06 03:46:31eric.araujosetnosy: +eric.araujo
messages: +msg162393
2012-06-06 03:12:22Yury.Selivanovsetmessages: +msg162390
2012-06-06 03:01:26Ramchandra Aptesetnosy: +Ramchandra Apte
messages: +msg162388
2012-06-06 01:57:39Alexandre.Zanisetnosy: +Alexandre.Zani
2012-06-05 22:06:43Yury.Selivanovcreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp