[Django] #34795: ConnectionProxy (and likely others) do not expose the `__dir__` of the object they are proxying

10 views
Skip to first unread message

Django

unread,
Aug 23, 2023, 12:34:38 PM8/23/23
to django-...@googlegroups.com
#34795: ConnectionProxy (and likely others) do not expose the `__dir__` of the
object they are proxying
--------------------------------------------+------------------------
Reporter: Willem Van Onsem | Owner: nobody
Type: Uncategorized | Status: new
Component: Core (Other) | Version: 4.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
--------------------------------------------+------------------------
Based on this question: https://stackoverflow.com/q/76963171/67579 the
`ConnectionProxy` does not communicate the `__dir__` of the object it is
exposing. As a result, shells, etc. can not help with code completion.

Overriding `__dir__` and returning the `dir(..)` of the items it exposes
is however quite easy.

--
Ticket URL: <https://code.djangoproject.com/ticket/34795>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 23, 2023, 9:54:59 PM8/23/23
to django-...@googlegroups.com
#34795: ConnectionProxy (and likely others) do not expose the `__dir__` of the
object they are proxying
----------------------------------+--------------------------------------

Reporter: Willem Van Onsem | Owner: nobody
Type: Uncategorized | Status: closed

Component: Core (Other) | Version: 4.2
Severity: Normal | Resolution: wontfix

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
----------------------------------+--------------------------------------
Changes (by Natalia Bidart):

* status: new => closed
* resolution: => wontfix


Comment:

Hello, thank you for your ticket.

I don't see much value in providing this vs the potential side effects of
calling `dir` on the proxied connection.

If you disagree, the recommended path forward in cases like this is to
first propose and discuss the idea with the community and gain consensus.
To do that, please start a new conversation on the
[https://forum.djangoproject.com/c/internals/5 Django Forum], where you'll
reach a wider audience and likely get richer feedback.

I'll close the ticket for now, but once that there is a community
agreement for the feature request, you are welcome to come back to the
ticket and point to the forum topic, so we can then re-open it. For more
details, please see
[https://docs.djangoproject.com/en/stable/internals/contributing/bugs-and-
features/#requesting-features the documented guidelines for requesting
features].

Thanks!

--
Ticket URL: <https://code.djangoproject.com/ticket/34795#comment:1>

Django

unread,
Aug 24, 2023, 8:27:41 AM8/24/23
to django-...@googlegroups.com
#34795: ConnectionProxy (and likely others) do not expose the `__dir__` of the
object they are proxying
----------------------------------+--------------------------------------
Reporter: Willem Van Onsem | Owner: nobody
Type: New feature | Status: closed

Component: Core (Other) | Version: 4.2
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0

----------------------------------+--------------------------------------
Changes (by Natalia Bidart):

* type: Uncategorized => New feature
* easy: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/34795#comment:2>

Reply all
Reply to author
Forward
0 new messages