This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2012年06月05日 22:06 by Yury.Selivanov, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| 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 of PEP 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 by PEP 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.qualname 2. Added Signature.__eq__ and __ne__ 3. signature() supports classes, metaclasses, decorated stuff, partials, methods, classmethods, callable objects etc 4. signature() does a deepcopy of __signature__ attribute if there is one 5. No implicit caching anywhere 6. 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 callables 3. '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 interpreters 3. 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 than foo == bar \ and bar == baz \ and baz == asd Have you measured the coverage of the tests? |
|||
| msg163203 - (view) | Author: Yury Selivanov (Yury.Selivanov) * | Date: 2012年06月19日 19:26 | |
New patch - pep362.6.patch Ezio, 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.patch Summary: 1. Signature & Parameter objects are now immutable 2. Signature.replace() and Parameter.replace() 3. Signature has a new default constructor, which accepts parameters list and a return_annotation; and a new 'from_function', which create a Signature object for 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.patch One 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 changeset d892bf410478 by Larry Hastings in branch 'default': Issue #15008: Implement PEP 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 | |||
|---|---|---|---|
| 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 | |