title: sqlalchemy filter_by() got one more argument
body: <pre><code>environment:
      python 3.6.4
      SQLAlchemy==1.2.7
  </code></pre>
  
  <p>I wrote this code and it works.</p>
  
  <p>1.</p>
  
  <pre><code>filter_data = session.query(MyClass).filter_by(form_type=form_type).one()
  </code></pre>
  
  <p>and I want to cut function , I wrote below code, but it raise exception.</p>
  
  <p>2.</p>
  
  <pre><code>def myfunc(session, instance, **query):
  
      class_name = type(instance).__name__
  
      try:
          ins = session.query(class_name).filter_by(query).one()
          ...
  
  
  myfunc(session, new_data, form_type=form_type)
  </code></pre>
  
  <p>exception is below</p>
  
  <pre><code>ins = session.query(class_name).filter_by(query).one()
  TypeError: filter_by() takes 1 positional argument but 2 were given
  </code></pre>
  
  <p>in function filter_by at query.py of sqlalchemy.orm, I add below code to debug.</p>
  
  <pre><code>def filter_by(self, **kwargs):
      l = locals()
      print(f'locals are: {l}')
  
      ...
  </code></pre>
  
  <p>it shows,</p>
  
  <p>case 1.</p>
  
  <pre><code>locals are: {'kwargs': {'form_type': 'TAX'}, 'self': &lt;sqlalchemy.orm.query.Query object at 0x1065d8470&gt;}
  </code></pre>
  
  <p>case 2.</p>
  
  <pre><code>locals are: {'kwargs': {'form_type': 'TAX'}, 'self': &lt;sqlalchemy.orm.query.Query object at 0x10b7b54a8&gt;}
  </code></pre>
  
  <p>It seems to me the same...<br>
  What's the wrong with above two?</p>