title: How do I use the "ANY" filter in conjucntion with the "<<=" operator in SQLAlchemy?
body: <p>I have a table with INET columns and want to run a query filtering all entries which are in any of a set of given networks. For example:</p>
  
  <pre><code>CREATE TABLE foo (
     cidr INET
  );
  </code></pre>
  
  <p>In SQL I can write the following:</p>
  
  <pre><code>SELECT cidr FROM foo WHERE cidr &lt;&lt;= ANY '{"192.168.1.0/24", "192.168.3.0/24"}';
  </code></pre>
  
  <p>I found <a href="http://docs.sqlalchemy.org/en/latest/dialects/postgresql.html#sqlalchemy.dialects.postgresql.Any" rel="nofollow noreferrer">the "any" operator in SQLAlchemy</a> which works well for standard operators, but cannot get it to work with the <code>&lt;&lt;=</code> operator. How do I do that?</p>
  
  <p>So I have something like this:</p>
  
  <pre><code>from sqlalchemy.dialects.postgresql import Any
  
  query = session.query(Foo)
  query = query.filter(Any(
      Foo.cidr,
      [ip_network('192.168.1.0/24'), ip_network('192.168.3.0/24')],
      operator=?  # &lt;-- What do I need to put here?
  ))
  </code></pre>
  
  <p>Additionally, the model defines a custom type to adapt the "ip_network" type to the appropriate DB type. This change prevents me from using a <code>text</code> construct with bound params, so currently I have to resort to string concatenations.</p>