[issue44523] weakref.proxy documentation might be outdated

2021-06-29 Thread miss-islington
miss-islington added the comment: New changeset 2df13e1211cf420bf6557df02e694bf1653a0ebe by Miss Islington (bot) in branch '3.10': bpo-44523: Remove the pass-through for hash() in weakref proxy objects (GH-26950) https://github.com/python/cpython/commit/2df13e1211cf420bf6557df02e694bf1653a0e

[issue44523] weakref.proxy documentation might be outdated

2021-06-29 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset f790bc8084d3dfd723889740f9129ac8fcb2fa02 by Miss Islington (bot) in branch '3.9': bpo-44523: Remove the pass-through for hash() in weakref proxy objects (GH-26950) (GH-26960) https://github.com/python/cpython/commit/f790bc8084d3dfd723889

[issue44523] weakref.proxy documentation might be outdated

2021-06-29 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue44523] weakref.proxy documentation might be outdated

2021-06-29 Thread miss-islington
Change by miss-islington : -- pull_requests: +25526 pull_request: https://github.com/python/cpython/pull/26960 ___ Python tracker ___ __

[issue44523] weakref.proxy documentation might be outdated

2021-06-29 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset e2fea101fd5517f33371b04432842b971021c3bf by Pablo Galindo in branch 'main': bpo-44523: Remove the pass-through for hash() in weakref proxy objects (GH-26950) https://github.com/python/cpython/commit/e2fea101fd5517f33371b04432842b971021c3

[issue44523] weakref.proxy documentation might be outdated

2021-06-29 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +25525 pull_request: https://github.com/python/cpython/pull/26959 ___ Python tracker _

[issue44523] weakref.proxy documentation might be outdated

2021-06-29 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Just also to be clear on my original message, reverting it to a previous behaviour would disallow some patterns that could be useful: >>> class A: ... ... ... >>> a = A() >>> d = {a: None} >>> weakref.proxy(a) in d True But I agree is better to reve

[issue44523] weakref.proxy documentation might be outdated

2021-06-29 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Thanks Neil for your input. I am indeed reverting that change to its previous behaviour. -- ___ Python tracker ___ __

[issue44523] weakref.proxy documentation might be outdated

2021-06-29 Thread Neil Schemenauer
Neil Schemenauer added the comment: It seems to me the old behaviour (don't forward hash) was done for good reasons. If the referent might go away, it is not valid to use it as a dict key since the hash and eq result changes. If it can't go away, what reason is there to use a weakref and n

[issue44523] weakref.proxy documentation might be outdated

2021-06-29 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +25518 pull_request: https://github.com/python/cpython/pull/26950 ___ Python tracker ___ ___

[issue44523] weakref.proxy documentation might be outdated

2021-06-28 Thread Jack DeVries
Jack DeVries added the comment: I'm going to close my PR; it seems like documentation is not the direction we're going, so no need to keep it open. -- ___ Python tracker ___

[issue44523] weakref.proxy documentation might be outdated

2021-06-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: Pablo, I'm having second thoughts on hash forwarding. It looks like its omission was an intentional design decision. I vote for restoring the previous behavior. That will likely save some headaches for some users. -- nosy: +rhettinger

[issue44523] weakref.proxy documentation might be outdated

2021-06-28 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Antoine, Neil, what do you think about this? -- nosy: +nascheme, pitrou ___ Python tracker ___ ___

[issue44523] weakref.proxy documentation might be outdated

2021-06-28 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I assume that the original comment is referring to the case when a proxy is a key and the original dies, but this just makes the thing inoperable, as expected: >>> class A: ... ... ... >>> a = A() >>> p = weakref.proxy(a) >>> d = {p: 42} >>> a in d

[issue44523] weakref.proxy documentation might be outdated

2021-06-28 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: In my view, proxies should behave almost exactly as the underliying object, so using them is as ergonomic as possible. For instance, when using them as a way to avoid cycles, is quite annoying if you have a hashable object in a dictionary and they fai

[issue44523] weakref.proxy documentation might be outdated

2021-06-28 Thread Jack DeVries
Change by Jack DeVries : -- keywords: +patch nosy: +jack__d nosy_count: 3.0 -> 4.0 pull_requests: +25505 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26936 ___ Python tracker _

[issue44523] weakref.proxy documentation might be outdated

2021-06-28 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: docs@python -> pablogsal nosy: +pablogsal ___ Python tracker ___ ___ Python-bugs-list mai

[issue44523] weakref.proxy documentation might be outdated

2021-06-28 Thread Alexander Neumann
New submission from Alexander Neumann : The documentation currently states: > Proxy objects are not hashable regardless of the referent; this avoids a > number of problems related to their fundamentally mutable nature, and prevent > their use as dictionary keys. callback is the same as the pa