diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-05-25 18:04:58 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-05-27 16:45:59 -0400 |
| commit | e573752a986dec84216d948a1497b7d789d039ea (patch) | |
| tree | 5c887df82321af54d1ccd445a16660fc0aa81707 /lib/sqlalchemy/sql/expression.py | |
| parent | 402da5f3f0bade44c2941ab8446f69cf33f5dd67 (diff) | |
| download | sqlalchemy-e573752a986dec84216d948a1497b7d789d039ea.tar.gz | |
Hold implicitly created collections in a pending area
Accessing a collection-oriented attribute on a newly created object no
longer mutates ``__dict__``, but still returns an empty collection as has
always been the case. This allows collection-oriented attributes to work
consistently in comparison to scalar attributes which return ``None``, but
also don't mutate ``__dict__``. In order to accommodate for the collection
being mutated, the same empty collection is returned each time once
initially created, and when it is mutated (e.g. an item appended, added,
etc.) it is then moved into ``__dict__``. This removes the last of
mutating side-effects on read-only attribute access within the ORM.
Fixes: #4519
Change-Id: I06a058d24e6eb24b5c6b6092d3f8b31cf9c244ae
Diffstat (limited to 'lib/sqlalchemy/sql/expression.py')
0 files changed, 0 insertions, 0 deletions
