zzzeek/sqlalchemy — pull request #9 by ijl (2013-06-21 04:41:03+00:00)
Title: #2628: types.Variant() has a __repr__ usable by Alembic

This pull request is meant to fix [Trac ticket #2628](http://www.sqlalchemy.org/trac/ticket/2628) 'need a working __repr__ for Variant".

Note that generic_repr() now builds kwargs into the repr by looking for a __kwargs_signature__ attribute in the to_inspect object. This complements inspect.getargspec() in building the list of all arguments and whether they are non-default. So any type that accepts kwargs will need to define this attribute in order to have a comprehensive repr. That's something to keep up to date in the future, but the only alternative I saw was to refactor any type using an *arg or **kwargs into named arguments, which meant backwards-incompatibility for those Enums at the least.

Please see the tests in test_repr().