
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2013-04-08 10:48 bymichael.foord, last changed2022-04-11 14:57 byadmin. This issue is nowclosed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| issue17660.patch | kushal.das,2013-04-08 13:26 | initial patch | review | |
| issue17660_v3.patch | kushal.das,2014-04-14 17:07 | Updated patch with builtins module. | review | |
| Messages (11) | |||
|---|---|---|---|
| msg186290 -(view) | Author: Michael Foord (michael.foord)*![]() | Date: 2013-04-08 10:48 | |
When patching builtin names (e.g. open) in a specific namespace you need to specify "create=True" or patch will refuse to create a name that doesn't exist.patch could whitelist the builtin names, when the patch target is a module object, to not require the "create=True". | |||
| msg186291 -(view) | Author: Kushal Das (kushal.das)*![]() | Date: 2013-04-08 10:52 | |
Working on this. | |||
| msg186301 -(view) | Author: Kushal Das (kushal.das)*![]() | Date: 2013-04-08 13:26 | |
Initial patchset along with documentation and tests update. | |||
| msg186323 -(view) | Author: Antoine Pitrou (pitrou)*![]() | Date: 2013-04-08 18:17 | |
To be honest this proposal sounds like a quirk more than a feature to me. If you only special-case builtins, people will have to remember that special case and it will make the API more complicated. | |||
| msg186347 -(view) | Author: Michael Foord (michael.foord)*![]() | Date: 2013-04-08 21:02 | |
I don't think that's a particular issue. In general you only need to use "create=True" if a name is *not* available in a namespace. Builtin names are odd in that you can use them in a namespace even though they don't exist there - so you have to *remember* to use "create=True" even though the name *is* available. So this issue is about fixing that quirk. | |||
| msg215917 -(view) | Author: Éric Araujo (eric.araujo)*![]() | Date: 2014-04-11 06:21 | |
Reviewed on Rietveld. | |||
| msg216113 -(view) | Author: Kushal Das (kushal.das)*![]() | Date: 2014-04-14 17:07 | |
Updated patch with builtins module. | |||
| msg216201 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2014-04-14 20:25 | |
New changesete457de60028c by Michael Foord in branch 'default':Closesissue 17660. You no longer need to explicitly pass create=True when patching builtin names.http://hg.python.org/cpython/rev/e457de60028c | |||
| msg216360 -(view) | Author: Berker Peksag (berker.peksag)*![]() | Date: 2014-04-15 18:52 | |
+ .. note::I think using a note directive is not necessary here. Also it looks a bit ugly :)https://dl.dropboxusercontent.com/u/166024/issue17660.png+ .. versionchanged:: 3.5+ If you are patching builtins in a module then you don't+ need to pass `create=True`, it will be added by default. | |||
| msg216364 -(view) | Author: Michael Foord (michael.foord)*![]() | Date: 2014-04-15 19:26 | |
Personally I don't think it looks ugly and that it is a point worth calling out. Other opinions welcomed. | |||
| msg216366 -(view) | Author: Éric Araujo (eric.araujo)*![]() | Date: 2014-04-15 19:28 | |
I noticed this in the commit; I don’t think the rendered output is really ugly, but the markup does look strange, as it’s two nested note(-like) directives. | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:57:44 | admin | set | github: 61860 |
| 2014-04-15 19:28:37 | eric.araujo | set | messages: +msg216366 |
| 2014-04-15 19:26:09 | michael.foord | set | messages: +msg216364 |
| 2014-04-15 18:52:49 | berker.peksag | set | nosy: +berker.peksag messages: +msg216360 |
| 2014-04-14 20:25:31 | python-dev | set | status: open -> closed nosy: +python-dev messages: +msg216201 resolution: fixed stage: patch review -> resolved |
| 2014-04-14 17:53:49 | eric.araujo | set | versions: + Python 3.5, - Python 3.4 |
| 2014-04-14 17:07:41 | kushal.das | set | files: +issue17660_v3.patch messages: +msg216113 versions: + Python 3.4, - Python 3.5 |
| 2014-04-11 06:21:00 | eric.araujo | set | versions: + Python 3.5, - Python 3.4 nosy: +eric.araujo messages: +msg215917 stage: needs patch -> patch review |
| 2013-04-08 21:02:08 | michael.foord | set | messages: +msg186347 |
| 2013-04-08 18:17:07 | pitrou | set | nosy: +pitrou messages: +msg186323 |
| 2013-04-08 13:26:19 | kushal.das | set | files: +issue17660.patch keywords: +patch messages: +msg186301 |
| 2013-04-08 10:52:24 | kushal.das | set | nosy: +kushal.das messages: +msg186291 |
| 2013-04-08 10:48:09 | michael.foord | create | |