#27754: Please document that Django models implement __dict__ (or tell me they
officially don't)
----------------------------------+--------------------------------------
     Reporter:  Dave Schweisguth  |                    Owner:  nobody
         Type:  Bug               |                   Status:  closed
    Component:  Documentation     |                  Version:  1.10
     Severity:  Normal            |               Resolution:  invalid
     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 Carl Meyer):

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


Comment:

 `__dict__` is not a method, it's an attribute. All Python objects have it
 (except those that define `__slots__`). It does not make sense for Django
 to document that Django models have it, because a) it's a private
 attribute and an internal implementation detail of Python, that you should
 probably avoid relying on in your code, although many people use it
 anyway, and b) it's part of Python, not Django. If we documented every
 aspect of Python objects that happens to be true for Django objects too
 (because they are all Python objects), we'd be duplicating a bunch of the
 Python docs.

 I don't know why PyCharm doesn't like you using `__dict__`; maybe because
 it's a private double-underscore attribute. You can point them to the
 Python documentation at
 https://docs.python.org/3/library/stdtypes.html#object.__dict__ but
 there's nothing for Django to document here.

--
Ticket URL: <https://code.djangoproject.com/ticket/27754#comment:2>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.b91fcfe21fe0c510e618738b06699081%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to