diff options
author | Steven Loria <sloria1@gmail.com> | 2019-09-09 10:48:29 -0400 |
---|---|---|
committer | sqla-tester <sqla-tester@sqlalchemy.org> | 2019-09-09 10:48:29 -0400 |
commit | edcfc262a33bf8cbe509f2640e55d3361232c185 (patch) | |
tree | 8ad357d577d9601cf284985b28ecbb59ba518865 /lib/sqlalchemy/orm/attributes.py | |
parent | 17b7b3027f0e994cf47bf5fa3e536d3971076dcd (diff) | |
download | sqlalchemy-edcfc262a33bf8cbe509f2640e55d3361232c185.tar.gz |
Remove unnecessary util.callable usage
Fixes: #4850
<!-- Provide a general summary of your proposed changes in the Title field above -->
### Description
<!-- Describe your changes in detail -->
Removes usage of `util.callable`.
### Checklist
<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)
-->
This pull request is:
- [ ] A documentation / typographical error fix
- Good to go, no issue or tests are needed
- [x] A short code fix
- please include the issue number, and create an issue if none exists, which
must include a complete example of the issue. one line code fixes without an
issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests. one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.
**Have a nice day!**
Closes: #4851
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4851
Pull-request-sha: a0ccdff2cb74f5e944d8baccc269c382b591c8e2
Change-Id: I79918f44becbc5dbefdc7ff65128695c1cabed1d
Diffstat (limited to 'lib/sqlalchemy/orm/attributes.py')
-rw-r--r-- | lib/sqlalchemy/orm/attributes.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/sqlalchemy/orm/attributes.py b/lib/sqlalchemy/orm/attributes.py index d50eab03e..9d404e00d 100644 --- a/lib/sqlalchemy/orm/attributes.py +++ b/lib/sqlalchemy/orm/attributes.py @@ -328,7 +328,7 @@ def create_proxied_attribute(descriptor): @util.memoized_property def comparator(self): - if util.callable(self._comparator): + if callable(self._comparator): self._comparator = self._comparator() if self._adapt_to_entity: self._comparator = self._comparator.adapt_to_entity( @@ -702,8 +702,10 @@ class AttributeImpl(object): if not passive & CALLABLES_OK: return PASSIVE_NO_RESULT - if self.accepts_scalar_loader and \ - key in state.expired_attributes: + if ( + self.accepts_scalar_loader + and key in state.expired_attributes + ): value = state._load_expired(state, passive) elif key in state.callables: callable_ = state.callables[key] |