Re: [Sqlalchemy-tickets] [sqlalchemy] #2726: ColumnClause pretends to be iterable and then isn't
Brought to you by:
zzzeek
|
From: sqlalchemy <mi...@zz...> - 2013-05-14 02:06:03
|
#2726: ColumnClause pretends to be iterable and then isn't
----------------------------------+------------------------------------
Reporter: gthb | Owner: zzzeek
Type: defect | Status: new
Priority: medium | Milestone: 0.8.xx
Component: sql | Severity: no triage selected yet
Resolution: | Keywords:
Progress State: awaiting triage |
----------------------------------+------------------------------------
Comment (by gthb):
Hopefully nothing, for a while. :) (Our codebase is not a library, does
not need to run on Python 3 until either (a) we want it to, or (b)
libraries we want to use no longer support 2.7.x, neither of which seems
imminent.)
We're not only detecting lists/tuples/sets, it's also generators, and our
own types with `__iter__` defined. So just `isinstance(o, (list, tuple,
set))` or `isinstance(o, collections.Sequence)` wouldn't hack it. In these
(fairly common) cases we're looking for anything iterable that isn't a
string. Presumably we'll just end up saying that verbatim, i.e.
`isinstance(o, collections.Iterable) and not isinstance(o, basestring)`,
which isn't much neater, but at least explicit.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2726#comment:2>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|