classification
Title: Add __qualname__ to functools.WRAPPER_ASSIGNMENTS
Type: behavior Stage: resolved
Components: Versions: Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Ramchandra Apte, eric.araujo, gruszczy, meador.inge, ncoghlan, pitrou, python-dev, rhettinger
Priority: release blocker Keywords: easy, patch

Created on 2011-12-06 23:20 by ncoghlan, last changed 2011-12-12 17:46 by meador.inge. This issue is now closed.

Files
File name Uploaded Description Edit
13544.patch gruszczy, 2011-12-10 22:03 review
issue13544-1.patch meador.inge, 2011-12-11 04:08 review
13544_2.patch gruszczy, 2011-12-11 11:48 review
Messages (13)
msg148943 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2011-12-06 23:20
functools.update_wrapper() and functools.wraps() should copy the new property by default.
msg149193 - (view) Author: Filip Gruszczyński (gruszczy) Date: 2011-12-10 22:03
Patch with tests.
msg149208 - (view) Author: Meador Inge (meador.inge) * (Python committer) Date: 2011-12-11 04:08
Filip, with the exception of some minor whitespace problems (remember to run 
'make patchcheck') and a missed testcase in 'TestWraps.test_default_update', 
this looks good to me.  I was just about to attach a similar patch.  Here is
an updated patch with those minor fixes.

Nick, does this look OK to you?
msg149219 - (view) Author: Filip Gruszczyński (gruszczy) Date: 2011-12-11 10:08
I didn't know about `make patchcheck`, next time I will use it, thanks.
msg149220 - (view) Author: Ramchandra Apte (Ramchandra Apte) * Date: 2011-12-11 10:17
Remove the "needs patch" keyword since this bug has a patch.
msg149222 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2011-12-11 10:42
Explicitly spelling out __qualname__ like that makes the tests a bit too sensitive to otherwise irrelevant details of the test layout.

I suggest using comparisons like "self.assertEqual(wrapper.__qualname__, f.__qualname__)" and "self.assertNotEqual(wrapper.__qualname__, f.__qualname__)" to make sure they're the same or different as appropriate, without caring about their precise value (this is similar to what the tests already do for "dict_attr")
msg149224 - (view) Author: Filip Gruszczyński (gruszczy) Date: 2011-12-11 11:48
Fixed tests.
msg149267 - (view) Author: Meador Inge (meador.inge) * (Python committer) Date: 2011-12-12 01:28
On Sun, Dec 11, 2011 at 4:42 AM, Nick Coghlan <report@bugs.python.org> wrote:

> Explicitly spelling out __qualname__ like that makes the tests a bit too sensitive to otherwise irrelevant details of the test layout.
>
> I suggest using comparisons like "self.assertEqual(wrapper.__qualname__, f.__qualname__)" and "self.assertNotEqual(wrapper.__qualname__,
> f.__qualname__)" to make sure they're the same or different as appropriate, without caring about their precise value (this is similar to what the tests
> already do for "dict_attr")

Good point.  I will commit Filip's latest patch that has these fixes.
msg149274 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-12-12 04:54
New changeset 963e98f5ad31 by Meador Inge in branch 'default':
Issue #13544: Add __qualname__ to functools.WRAPPER_ASSIGNMENTS.
http://hg.python.org/cpython/rev/963e98f5ad31
msg149275 - (view) Author: Meador Inge (meador.inge) * (Python committer) Date: 2011-12-12 04:57
Thanks for the patch Filip.
msg149278 - (view) Author: Filip Gruszczyński (gruszczy) Date: 2011-12-12 08:58
Pleasure :-)
msg149336 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-12-12 17:31
I suppose the status can be switched to "closed"?
msg149339 - (view) Author: Meador Inge (meador.inge) * (Python committer) Date: 2011-12-12 17:46
Yup, oversight on my part.  Thanks.
History
Date User Action Args
2011-12-12 17:46:48meador.ingesetstatus: open -> closed

messages: + msg149339
2011-12-12 17:31:52pitrousetnosy: + pitrou
messages: + msg149336
2011-12-12 08:58:22gruszczysetmessages: + msg149278
2011-12-12 04:57:32meador.ingesettype: behavior
resolution: fixed
messages: + msg149275
stage: patch review -> resolved
2011-12-12 04:54:39python-devsetnosy: + python-dev
messages: + msg149274
2011-12-12 01:28:29meador.ingesetmessages: + msg149267
2011-12-11 11:48:34gruszczysetfiles: + 13544_2.patch

messages: + msg149224
2011-12-11 10:42:50ncoghlansetmessages: + msg149222
stage: needs patch -> patch review
2011-12-11 10:17:46Ramchandra Aptesetnosy: + Ramchandra Apte
messages: + msg149220
2011-12-11 10:08:05gruszczysetmessages: + msg149219
2011-12-11 04:08:57meador.ingesetfiles: + issue13544-1.patch
nosy: + meador.inge
messages: + msg149208

2011-12-10 22:03:47gruszczysetfiles: + 13544.patch

nosy: + gruszczy
messages: + msg149193

keywords: + patch
2011-12-10 15:43:12eric.araujosetnosy: + rhettinger, eric.araujo
2011-12-06 23:20:27ncoghlancreate