Skip to content

Commit

Permalink
Removed the leading underscore for visitor_iterator property
Browse files Browse the repository at this point in the history
A leading underscore usually denotes a private member. Since this
is a property and it is used in Query I removed the leading underscore

Change-Id: I8a35c09fd6d20ee0a13568ed7257a08b7bee2a08
Pull-request: sqlalchemy/sqlalchemy#4398
  • Loading branch information
agamrafaeli authored and zzzeek committed Dec 5, 2018
1 parent e0200cf commit 23224f6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/sqlalchemy/orm/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def _adapt_clause(self, clause, as_filter, orm_only):
orm_only = False

if as_filter and self._filter_aliases:
for fa in self._filter_aliases._visitor_iterator:
for fa in self._filter_aliases.visitor_iterator:
adapters.append(
(
orm_only, fa.replace
Expand Down
8 changes: 4 additions & 4 deletions lib/sqlalchemy/sql/visitors.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class ClauseVisitor(object):
__traverse_options__ = {}

def traverse_single(self, obj, **kw):
for v in self._visitor_iterator:
for v in self.visitor_iterator:
meth = getattr(v, "visit_%s" % obj.__visit_name__, None)
if meth:
return meth(obj, **kw)
Expand All @@ -142,7 +142,7 @@ def _visitor_dict(self):
return visitors

@property
def _visitor_iterator(self):
def visitor_iterator(self):
"""iterate through this visitor and each 'chained' visitor."""

v = self
Expand All @@ -156,7 +156,7 @@ def chain(self, visitor):
the chained visitor will receive all visit events after this one.
"""
tail = list(self._visitor_iterator)[-1]
tail = list(self.visitor_iterator)[-1]
tail._next = visitor
return self

Expand Down Expand Up @@ -200,7 +200,7 @@ def traverse(self, obj):
"""traverse and visit the given expression structure."""

def replace(elem):
for v in self._visitor_iterator:
for v in self.visitor_iterator:
e = v.replace(elem)
if e is not None:
return e
Expand Down

0 comments on commit 23224f6

Please sign in to comment.