
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2012-06-05 22:06 byYury.Selivanov, last changed2022-04-11 14:57 byadmin. This issue is nowclosed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| pep362.1.patch | Yury.Selivanov,2012-06-05 22:06 | review | ||
| pep362.2.patch | Yury.Selivanov,2012-06-14 02:29 | review | ||
| pep362.3.patch | Yury.Selivanov,2012-06-15 18:04 | review | ||
| pep362.4.patch | Yury.Selivanov,2012-06-19 02:27 | review | ||
| pep362.5.patch | Yury.Selivanov,2012-06-19 17:58 | review | ||
| pep362.6.patch | Yury.Selivanov,2012-06-19 19:26 | review | ||
| pep362.7.patch | Yury.Selivanov,2012-06-21 17:15 | review | ||
| pep362.8.patch | Yury.Selivanov,2012-06-22 20:11 | review | ||
| 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)*![]() | 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)*![]() | 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)*![]() | 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)![]() | 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)*![]() | Date: 2012-07-25 22:33 | |
Are we going to get documentation? | |||
| msg166440 -(view) | Author: Yury Selivanov (yselivanov)*![]() | Date: 2012-07-25 23:22 | |
Benjamin:http://bugs.python.org/issue15151 | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:57:31 | admin | set | github: 59213 |
| 2012-07-25 23:22:48 | yselivanov | set | nosy: +yselivanov messages: +msg166440 |
| 2012-07-25 22:33:54 | benjamin.peterson | set | nosy: +benjamin.peterson messages: +msg166431 |
| 2012-06-26 02:29:46 | eric.araujo | link | issue8916 superseder |
| 2012-06-22 22:26:05 | larry | set | stage: patch review -> resolved |
| 2012-06-22 22:24:52 | Yury.Selivanov | set | status: open -> closed resolution: fixed |
| 2012-06-22 22:20:13 | python-dev | set | nosy: +python-dev messages: +msg163500 |
| 2012-06-22 20:11:40 | Yury.Selivanov | set | files: +pep362.8.patch messages: +msg163477 |
| 2012-06-21 17:15:15 | Yury.Selivanov | set | files: +pep362.7.patch messages: +msg163352 |
| 2012-06-19 19:26:33 | Yury.Selivanov | set | files: +pep362.6.patch messages: +msg163203 |
| 2012-06-19 18:38:34 | ezio.melotti | set | nosy: +ezio.melotti messages: +msg163202 |
| 2012-06-19 17:59:04 | Yury.Selivanov | set | files: +pep362.5.patch messages: +msg163197 |
| 2012-06-19 02:29:05 | Yury.Selivanov | set | messages: +msg163134 |
| 2012-06-19 02:27:42 | Yury.Selivanov | set | files: +pep362.4.patch messages: +msg163133 |
| 2012-06-16 16:52:40 | eric.araujo | set | messages: +msg162979 |
| 2012-06-15 18:04:35 | Yury.Selivanov | set | files: +pep362.3.patch messages: +msg162927 |
| 2012-06-14 02:29:37 | Yury.Selivanov | set | files: +pep362.2.patch messages: +msg162748 |
| 2012-06-06 03:47:00 | eric.araujo | set | keywords: +needs review title: PEP 362 reference implementation for 3.3 -> PEP 362 "Signature Objects" reference implementation stage: patch review |
| 2012-06-06 03:46:31 | eric.araujo | set | nosy: +eric.araujo messages: +msg162393 |
| 2012-06-06 03:12:22 | Yury.Selivanov | set | messages: +msg162390 |
| 2012-06-06 03:01:26 | Ramchandra Apte | set | nosy: +Ramchandra Apte messages: +msg162388 |
| 2012-06-06 01:57:39 | Alexandre.Zani | set | nosy: +Alexandre.Zani |
| 2012-06-05 22:06:43 | Yury.Selivanov | create | |