diff options
author | Ceridwen <ceridwenv@gmail.com> | 2015-07-13 21:47:10 -0400 |
---|---|---|
committer | Ceridwen <ceridwenv@gmail.com> | 2015-07-13 21:47:10 -0400 |
commit | 94520560b047a12b5e277fd73400491e8dc1172d (patch) | |
tree | 040858d60d4ff44c5778c64ddab0c4deb3410b31 /astroid/mixins.py | |
parent | d5be6c1926d6fa02b49b320faee5edb1e04f9fae (diff) | |
download | astroid-git-94520560b047a12b5e277fd73400491e8dc1172d.tar.gz |
Fix code review comments.
Added aliases for inferred() and assign_type(), refactor some uses of
ternary if, remove some now-unused internal functions in rebuilder,
replaced the mutating docstring function with one that returns values
as well as side-effects, change back to lazy-object-proxy, and add keyword
args to the Module call in rebuilder.
Diffstat (limited to 'astroid/mixins.py')
-rw-r--r-- | astroid/mixins.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/astroid/mixins.py b/astroid/mixins.py index bd63700f..6edccfbe 100644 --- a/astroid/mixins.py +++ b/astroid/mixins.py @@ -58,12 +58,26 @@ class FilterStmtsMixin(object): def assign_type(self): return self + def ass_type(self): + warnings.warn('%s.ass_type() is deprecated, ' + 'use %s.assign_type() instead.' + % (type(self).__name__, type(self).__name__), + PendingDeprecationWarning) + return self.assign_type() + class AssignTypeMixin(object): def assign_type(self): return self + def ass_type(self): + warnings.warn('%s.ass_type() is deprecated, ' + 'use %s.assign_type() instead.' + % (type(self).__name__, type(self).__name__), + PendingDeprecationWarning) + return self.assign_type() + def _get_filtered_stmts(self, lookup_node, node, _stmts, mystmt): """method used in filter_stmts""" if self is mystmt: @@ -80,6 +94,13 @@ class ParentAssignTypeMixin(AssignTypeMixin): def assign_type(self): return self.parent.assign_type() + def ass_type(self): + warnings.warn('%s.ass_type() is deprecated, ' + 'use %s.assign_type() instead.' + % (type(self).__name__, type(self).__name__), + PendingDeprecationWarning) + return self.assign_type() + class ImportFromMixin(FilterStmtsMixin): """MixIn for From and Import Nodes""" |