Opened 5 years ago

Closed 5 years ago

#30660 closed Cleanup/optimization (needsinfo)

Use of properites by Django and debugging in PyCharm

Reported by: piotrdt Owned by: nobody
Component: Uncategorized Version: 2.2
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Hello all,

It is my first ticket here so sorry if I messed something.

I've met an issue when developing an application with use of PyCharm and Django.
The issue is not top priority because it is related to debug.

Implementation of some properties by Django e.g.

@cached_property
def forms(self):

or more common:

    def __str__(self):
            return self.as_table()

does more than just provide access to some property.
Unfortunately PyCharm (and maybe some other python IDE also) evaluates some expressions during debug (e.g. when one wants to see what is the content of the variable)
That leads to strange situations, where content of instance of a class may be changed during debug.

I'm going to create a ticket in PyCharm bug tracker as well.

My suggestion is to implement properties in a way they do not affect content of an object they belong to.

Best regards,
Piotr P.

Change History (1)

comment:1 by Carlton Gibson, 5 years ago

Resolution: needsinfo
Status: newclosed

Hi.

I suspect this is a wontfix. It's the IDE's job to correctly inspect code.

I'm going to go with needsinfo just at the moment though, as I have no real idea what kind of changes you might be suggesting.
(I don't really understand what "My suggestion is to implement properties in a way they do not affect content of an object they belong to." means.)

With a concrete proposal we may be able to say more. Thanks.

Note: See TracTickets for help on using tickets.
Back to Top