Created on 2019-04-19 14:08 by bup, last changed 2019-04-26 08:46 by mark.dickinson. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 12932 | merged | mark.dickinson, 2019-04-24 08:12 | |
| Messages (6) | |||
|---|---|---|---|
| msg340553 - (view) | Author: SilentGhost (SilentGhost) * | Date: 2019-04-19 17:29 | |
It's not obvious why it should. Do you care to show a use case you had in mind? |
|||
| msg340760 - (view) | Author: Mark Dickinson (mark.dickinson) * | Date: 2019-04-24 07:36 | |
> It's not obvious why it should. I'd say that it's not obvious why it shouldn't. The "weakproxy" type currently supports every single "PyNumberMethods" slot *except* matrix multiplication: see https://github.com/python/cpython/blob/bf94cc7b496a379e1f604aa2e4080bb70ca4020e/Objects/weakrefobject.c#L610-L645 It seems likely that this was an unintentional omission when matrix multiplication was added. I can't think of any good reason to support all but one (well, two, including the in-place method) of those PyNumberMethods. Supporting all of them gives a (conceptually) smaller, simpler object. I think this is a consistency bug that should be fixed. |
|||
| msg340763 - (view) | Author: Mark Dickinson (mark.dickinson) * | Date: 2019-04-24 08:35 | |
Adding Nathaniel Smith (the matrix multiplication PEP author), just in case he knows some reason why weakref.proxy objects should _not_ support the matrix multiplication operator. |
|||
| msg340767 - (view) | Author: Nathaniel Smith (njs) * | Date: 2019-04-24 10:22 | |
Yeah, seems like a simple oversight to me. (Actually this is the first I've heard of weakref.proxy...) |
|||
| msg340885 - (view) | Author: Mark Dickinson (mark.dickinson) * | Date: 2019-04-26 06:56 | |
New changeset 7abb6c05afd02c17c7a941b64db5756b161b3cf7 by Mark Dickinson in branch 'master': bpo-36669: add matmul support to weakref.proxy (GH-12932) https://github.com/python/cpython/commit/7abb6c05afd02c17c7a941b64db5756b161b3cf7 |
|||
| msg340894 - (view) | Author: Mark Dickinson (mark.dickinson) * | Date: 2019-04-26 08:46 | |
Now fixed for 3.8. Although this was an oversight, I'm erring on the side of regarding this as a new feature for 3.8 (and I think the omission is unlikely to bite anyone for Python 3.7 or 3.6), so I wouldn't recommend backporting this. Thanks for the report! |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2019-04-26 08:46:22 | mark.dickinson | set | status: open -> closed resolution: fixed messages: + msg340894 stage: patch review -> resolved |
| 2019-04-26 06:56:19 | mark.dickinson | set | messages: + msg340885 |
| 2019-04-24 10:22:02 | njs | set | messages: + msg340767 |
| 2019-04-24 08:37:47 | mark.dickinson | set | assignee: mark.dickinson |
| 2019-04-24 08:35:18 | mark.dickinson | set | nosy:
+ njs messages: + msg340763 |
| 2019-04-24 08:12:37 | mark.dickinson | set | keywords:
+ patch stage: patch review pull_requests: + pull_request12857 |
| 2019-04-24 07:36:28 | mark.dickinson | set | status: pending -> open nosy: + mark.dickinson messages: + msg340760 |
| 2019-04-20 07:49:38 | SilentGhost | set | status: open -> pending |
| 2019-04-19 17:29:47 | SilentGhost | set | versions:
+ Python 3.8 nosy: + SilentGhost, fdrake messages: + msg340553 components:
+ Library (Lib) |
| 2019-04-19 14:08:57 | bup | create | |