diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2016-02-17 15:21:00 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2016-02-17 15:21:00 -0500 |
| commit | bf1d03a9e58a0256db0b1f7389e23a6d11c4a964 (patch) | |
| tree | a72c257e712500fd53a33a25a81c104e560ad802 /lib/sqlalchemy/sql | |
| parent | 591e0cf08a798fb16e0ee9b56df5c3141aa48959 (diff) | |
| download | sqlalchemy-bf1d03a9e58a0256db0b1f7389e23a6d11c4a964.tar.gz | |
- do the trailing comma logic of tuple repr() exactly
Diffstat (limited to 'lib/sqlalchemy/sql')
| -rw-r--r-- | lib/sqlalchemy/sql/util.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/sqlalchemy/sql/util.py b/lib/sqlalchemy/sql/util.py index 98d9cc944..d40bf48f1 100644 --- a/lib/sqlalchemy/sql/util.py +++ b/lib/sqlalchemy/sql/util.py @@ -311,8 +311,9 @@ class _repr_row(_repr_base): def __repr__(self): trunc = self.trunc - return "(%s)" % ( - "".join(trunc(value) + "," for value in self.row) + return "(%s%s)" % ( + ", ".join(trunc(value) for value in self.row), + "," if len(self.row) == 1 else "" ) @@ -391,8 +392,10 @@ class _repr_params(_repr_base): ) ) elif typ is self._TUPLE: - return "(%s)" % ( - "".join(trunc(value) + "," for value in params) + return "(%s%s)" % ( + ", ".join(trunc(value) for value in params), + "," if len(params) == 1 else "" + ) else: return "[%s]" % ( |
