#30660: Use of properites by Django and debugging in PyCharm
------------------------------------------------+------------------------
               Reporter:  piotrdt               |          Owner:  nobody
                   Type:  Cleanup/optimization  |         Status:  new
              Component:  Uncategorized         |        Version:  2.2
               Severity:  Normal                |       Keywords:
           Triage Stage:  Unreviewed            |      Has patch:  0
    Needs documentation:  0                     |    Needs tests:  0
Patch needs improvement:  0                     |  Easy pickings:  0
                  UI/UX:  0                     |
------------------------------------------------+------------------------
 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.
 {{{
 #!python
 @cached_property
 def forms(self):
 }}}
 or more common:
 {{{
 #!python
     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.

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/050.b8c00a75eea112afe79efca889d771c9%40djangoproject.com.

Reply via email to