]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Remove print statement in favor of print() function in docs and examples
authorAlbert Tugushev <albert@tugushev.ru>
Wed, 26 Feb 2020 16:09:29 +0000 (11:09 -0500)
committersqla-tester <sqla-tester@sqlalchemy.org>
Wed, 26 Feb 2020 16:09:29 +0000 (11:09 -0500)
<!-- Provide a general summary of your proposed changes in the Title field above -->

### Description
<!-- Describe your changes in detail -->
Remove print statements

### Checklist
<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)

-->

This pull request is:

- [X] A documentation / typographical error fix
- Good to go, no issue or tests are needed
- [ ] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #5166
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5166
Pull-request-sha: 04a7394f71298322188f0861b4dfe93e5485839d

Change-Id: Ib90a59fac929661a18748c6e44966fb87e3978c6

19 files changed:
doc/build/changelog/migration_11.rst
doc/build/core/defaults.rst
doc/build/faq/sqlexpressions.rst
examples/dogpile_caching/__init__.py
examples/elementtree/__init__.py
examples/graphs/__init__.py
examples/postgis/__init__.py
examples/vertical/__init__.py
lib/sqlalchemy/dialects/firebird/base.py
lib/sqlalchemy/dialects/firebird/fdb.py
lib/sqlalchemy/dialects/postgresql/base.py
lib/sqlalchemy/ext/compiler.py
lib/sqlalchemy/ext/hybrid.py
lib/sqlalchemy/orm/descriptor_props.py
lib/sqlalchemy/orm/events.py
lib/sqlalchemy/sql/elements.py
lib/sqlalchemy/sql/functions.py
lib/sqlalchemy/sql/selectable.py
lib/sqlalchemy/sql/sqltypes.py

index 43d3dab3796ec4d38240393a83c8c53e2d60570a..56eca62949e4514e0d41c65e7a99c49443b80aea 100644 (file)
@@ -1198,13 +1198,13 @@ RANGE and ROWS expressions for window functions::
 
     >>> from sqlalchemy import func
 
-    >>> print func.row_number().over(order_by='x', range_=(-5, 10))
+    >>> print(func.row_number().over(order_by='x', range_=(-5, 10)))
     row_number() OVER (ORDER BY x RANGE BETWEEN :param_1 PRECEDING AND :param_2 FOLLOWING)
 
-    >>> print func.row_number().over(order_by='x', rows=(None, 0))
+    >>> print(func.row_number().over(order_by='x', rows=(None, 0)))
     row_number() OVER (ORDER BY x ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
 
-    >>> print func.row_number().over(order_by='x', range_=(-2, None))
+    >>> print(func.row_number().over(order_by='x', range_=(-2, None)))
     row_number() OVER (ORDER BY x RANGE BETWEEN :param_1 PRECEDING AND UNBOUNDED FOLLOWING)
 
 :paramref:`.expression.over.range_` and :paramref:`.expression.over.rows` are specified as
@@ -1384,19 +1384,19 @@ New operators :meth:`.ColumnOperators.is_distinct_from` and
 :meth:`.ColumnOperators.isnot_distinct_from` allow the IS DISTINCT
 FROM and IS NOT DISTINCT FROM sql operation::
 
-    >>> print column('x').is_distinct_from(None)
+    >>> print(column('x').is_distinct_from(None))
     x IS DISTINCT FROM NULL
 
 Handling is provided for NULL, True and False::
 
-    >>> print column('x').isnot_distinct_from(False)
+    >>> print(column('x').isnot_distinct_from(False))
     x IS NOT DISTINCT FROM false
 
 For SQLite, which doesn't have this operator, "IS" / "IS NOT" is rendered,
 which on SQLite works for NULL unlike other backends::
 
     >>> from sqlalchemy.dialects import sqlite
-    >>> print column('x').is_distinct_from(None).compile(dialect=sqlite.dialect())
+    >>> print(column('x').is_distinct_from(None).compile(dialect=sqlite.dialect()))
     x IS NOT NULL
 
 .. _change_1957:
@@ -2322,7 +2322,7 @@ passed through the literal quoting system::
     >>> from sqlalchemy.schema import MetaData, Table, Column, CreateTable
     >>> from sqlalchemy.types import String
     >>> t = Table('t', MetaData(), Column('x', String(), server_default="hi ' there"))
-    >>> print CreateTable(t)
+    >>> print(CreateTable(t))
 
     CREATE TABLE t (
         x VARCHAR DEFAULT 'hi '' there'
index 0f975564926f818dd01528a673227c7b80955147..06963ac43698f55220325927a9d0508daebca55f 100644 (file)
@@ -396,7 +396,7 @@ appropriate for the target backend::
 
     >>> my_seq = Sequence('some_sequence')
     >>> stmt = select([my_seq.next_value()])
-    >>> print stmt.compile(dialect=postgresql.dialect())
+    >>> print(stmt.compile(dialect=postgresql.dialect()))
     SELECT nextval('some_sequence') AS next_value_1
 
 .. _sequence_metadata:
index 6a52e747df5d3ebba06fecd0010a0980d17b5066..0dd5e10df6f1a6d1c8cdb7030d40aa1ad8666b21 100644 (file)
@@ -201,16 +201,16 @@ What if we defaulted the value of :paramref:`.Operators.op.precedence` to 100,
 e.g. the highest?  Then this expression makes more parenthesis, but is
 otherwise OK, that is, these two are equivalent::
 
-    >>> print (column('q') - column('y')).op('+', precedence=100)(column('z'))
+    >>> print((column('q') - column('y')).op('+', precedence=100)(column('z')))
     (q - y) + z
-    >>> print (column('q') - column('y')).op('+')(column('z'))
+    >>> print((column('q') - column('y')).op('+')(column('z')))
     q - y + z
 
 but these two are not::
 
-    >>> print column('q') - column('y').op('+', precedence=100)(column('z'))
+    >>> print(column('q') - column('y').op('+', precedence=100)(column('z')))
     q - y + z
-    >>> print column('q') - column('y').op('+')(column('z'))
+    >>> print(column('q') - column('y').op('+')(column('z')))
     q - (y + z)
 
 For now, it's not clear that as long as we are doing parenthesization based on
index 91105dc020e87bcaf0d32632a0a25da2dcf5f68e..de4a339a7ba363b09e176bbe9d08d3c4114ee8af 100644 (file)
@@ -25,7 +25,7 @@ E.g.::
     q = q.options(RelationshipCache(Person.addresses, "default"))
 
     # query
-    print q.all()
+    print(q.all())
 
 To run, both SQLAlchemy and dogpile.cache must be
 installed or on the current PYTHONPATH. The demo will create a local
index 82bb873610f607f3add3824a10d2622f2c8eac1a..b2d90a739d7c117d77744bdedb18954a2ba7d298 100644 (file)
@@ -17,7 +17,7 @@ E.g.::
     # locate documents with a certain path/attribute structure
     for document in find_document('/somefile/header/field2[@attr=foo]'):
         # dump the XML
-        print document
+        print(document)
 
 .. autosource::
     :files: pickle_type.py, adjacency_list.py, optimized_al.py
index 0f8fe58a7bcf4e4485d6c40635514770ce191ec0..cd0d1ddd850516638c111b94fa6ac412c069eb7b 100644 (file)
@@ -6,7 +6,7 @@ and querying for lower- and upper- neighbors are illustrated::
     n2 = Node(2)
     n5 = Node(5)
     n2.add_neighbor(n5)
-    print n2.higher_neighbors()
+    print(n2.higher_neighbors())
 
 .. autosource::
 
index 963a561f3d2ea7116d1891710bf115635a8bcc27..dcdbfcf578fc411fb22295afba4a9c02990d56b8 100644 (file)
@@ -31,8 +31,8 @@ and simple to use extension points.
 
 E.g.::
 
-    print session.query(Road).filter(
-        Road.road_geom.intersects(r1.road_geom)).all()
+    print(session.query(Road).filter(
+        Road.road_geom.intersects(r1.road_geom)).all())
 
 .. autosource::
 
index 0e09b9a55d37064114573b1d4abb5e382f22ca72..b0c00b664e75c614141081745525663713f33262 100644 (file)
@@ -27,7 +27,7 @@ Example::
          filter(Animal.facts.any(
            and_(AnimalFact.key == u'weasel-like',
                 AnimalFact.value == True))))
-    print 'weasel-like animals', q.all()
+    print('weasel-like animals', q.all())
 
 .. autosource::
 
index d0711f27c3c5d548f9a49728f6185b4c688bdef0..51bda30a2b49130791432e1521806d2cb89abc7c 100644 (file)
@@ -63,13 +63,13 @@ the SQLAlchemy ``returning()`` method, such as::
     # INSERT..RETURNING
     result = table.insert().returning(table.c.col1, table.c.col2).\
                    values(name='foo')
-    print result.fetchall()
+    print(result.fetchall())
 
     # UPDATE..RETURNING
     raises = empl.update().returning(empl.c.id, empl.c.salary).\
                   where(empl.c.sales>100).\
                   values(dict(salary=empl.c.salary * 1.1))
-    print raises.fetchall()
+    print(raises.fetchall())
 
 
 .. _dialects: http://mc-computing.com/Databases/Firebird/SQL_Dialect.html
index 67d4060032af2675574c1e2db3b6f102a11e55b0..46acd05595b8feee4bf902a36f11e794cf58c58e 100644 (file)
@@ -42,7 +42,7 @@ accept every argument that Kinterbasdb does.
 
       conn = engine.connect().execution_options(enable_rowcount=True)
       r = conn.execute(stmt)
-      print r.rowcount
+      print(r.rowcount)
 
 * ``retaining`` - False by default.   Setting this to True will pass the
   ``retaining=True`` keyword argument to the ``.commit()`` and ``.rollback()``
index b30e7770498bf39e63f6a5afeedd478bd7f4cae6..0a442f2562224ccd8cad22a7fd84fe75fdf312c9 100644 (file)
@@ -273,17 +273,17 @@ use the :meth:`._UpdateBase.returning` method on a per-statement basis::
     # INSERT..RETURNING
     result = table.insert().returning(table.c.col1, table.c.col2).\
         values(name='foo')
-    print result.fetchall()
+    print(result.fetchall())
 
     # UPDATE..RETURNING
     result = table.update().returning(table.c.col1, table.c.col2).\
         where(table.c.name=='foo').values(name='bar')
-    print result.fetchall()
+    print(result.fetchall())
 
     # DELETE..RETURNING
     result = table.delete().returning(table.c.col1, table.c.col2).\
         where(table.c.name=='foo')
-    print result.fetchall()
+    print(result.fetchall())
 
 .. _postgresql_insert_on_conflict:
 
@@ -567,7 +567,7 @@ syntaxes. It uses SQLAlchemy's hints mechanism::
 
     # SELECT ... FROM ONLY ...
     result = table.select().with_hint(table, 'ONLY', 'postgresql')
-    print result.fetchall()
+    print(result.fetchall())
 
     # UPDATE ONLY ...
     table.update(values=dict(foo='bar')).with_hint('ONLY',
index 59c16f8037525205df9c043287382b8db1ec95dc..c27907cdcf6bd5fb4341440fc4e23af64f872a4d 100644 (file)
@@ -32,7 +32,7 @@ when the object is compiled to a string::
     from sqlalchemy import select
 
     s = select([MyColumn('x'), MyColumn('y')])
-    print str(s)
+    print(str(s))
 
 Produces::
 
@@ -90,7 +90,7 @@ method which can be used for compilation of embedded attributes::
         )
 
     insert = InsertFromSelect(t1, select([t1]).where(t1.c.x>5))
-    print insert
+    print(insert)
 
 Produces::
 
index fd06034eea426da1b85891edc3aa53124d265615..7c523edbd340e079eb352e46d38bf48d9a23990c 100644 (file)
@@ -66,10 +66,10 @@ descriptor evaluates the function body given the ``Interval`` class as
 the argument, which when evaluated with SQLAlchemy expression mechanics
 returns a new SQL expression::
 
-    >>> print Interval.length
+    >>> print(Interval.length)
     interval."end" - interval.start
 
-    >>> print Session().query(Interval).filter(Interval.length > 10)
+    >>> print(Session().query(Interval).filter(Interval.length > 10))
     SELECT interval.id AS interval_id, interval.start AS interval_start,
     interval."end" AS interval_end
     FROM interval
@@ -78,7 +78,7 @@ returns a new SQL expression::
 ORM methods such as :meth:`~.Query.filter_by` generally use ``getattr()`` to
 locate attributes, so can also be used with hybrid attributes::
 
-    >>> print Session().query(Interval).filter_by(length=5)
+    >>> print(Session().query(Interval).filter_by(length=5))
     SELECT interval.id AS interval_id, interval.start AS interval_start,
     interval."end" AS interval_end
     FROM interval
@@ -101,14 +101,14 @@ SQL expression-level boolean behavior::
     >>> i1.intersects(Interval(25, 29))
     False
 
-    >>> print Session().query(Interval).filter(Interval.contains(15))
+    >>> print(Session().query(Interval).filter(Interval.contains(15)))
     SELECT interval.id AS interval_id, interval.start AS interval_start,
     interval."end" AS interval_end
     FROM interval
     WHERE interval.start <= :start_1 AND interval."end" > :end_1
 
     >>> ia = aliased(Interval)
-    >>> print Session().query(Interval, ia).filter(Interval.intersects(ia))
+    >>> print(Session().query(Interval, ia).filter(Interval.intersects(ia)))
     SELECT interval.id AS interval_id, interval.start AS interval_start,
     interval."end" AS interval_end, interval_1.id AS interval_1_id,
     interval_1.start AS interval_1_start, interval_1."end" AS interval_1_end
@@ -153,7 +153,7 @@ object for class-level expressions::
     >>> i1.radius
     2
 
-    >>> print Session().query(Interval).filter(Interval.radius > 5)
+    >>> print(Session().query(Interval).filter(Interval.radius > 5))
     SELECT interval.id AS interval_id, interval.start AS interval_start,
         interval."end" AS interval_end
     FROM interval
@@ -325,8 +325,8 @@ However, at the expression level, it's expected that the ``User`` class will
 be used in an appropriate context such that an appropriate join to
 ``SavingsAccount`` will be present::
 
-    >>> print Session().query(User, User.balance).\
-    ...     join(User.accounts).filter(User.balance > 5000)
+    >>> print(Session().query(User, User.balance).
+    ...       join(User.accounts).filter(User.balance > 5000))
     SELECT "user".id AS user_id, "user".name AS user_name,
     account.balance AS account_balance
     FROM "user" JOIN account ON "user".id = account.user_id
@@ -390,7 +390,7 @@ we can adjust our ``SavingsAccount`` example to aggregate the balances for
 The above recipe will give us the ``balance`` column which renders
 a correlated SELECT::
 
-    >>> print s.query(User).filter(User.balance > 400)
+    >>> print(s.query(User).filter(User.balance > 400))
     SELECT "user".id AS user_id, "user".name AS user_name
     FROM "user"
     WHERE (SELECT sum(account.balance) AS sum_1
@@ -443,7 +443,7 @@ named ``word_insensitive``::
 Above, SQL expressions against ``word_insensitive`` will apply the ``LOWER()``
 SQL function to both sides::
 
-    >>> print Session().query(SearchWord).filter_by(word_insensitive="Trucks")
+    >>> print(Session().query(SearchWord).filter_by(word_insensitive="Trucks"))
     SELECT searchword.id AS searchword_id, searchword.word AS searchword_word
     FROM searchword
     WHERE lower(searchword.word) = lower(:lower_1)
@@ -579,7 +579,7 @@ The ``word_insensitive`` attribute now has case-insensitive comparison behavior
 universally, including SQL expression vs. Python expression (note the Python
 value is converted to lower case on the Python side here)::
 
-    >>> print Session().query(SearchWord).filter_by(word_insensitive="Trucks")
+    >>> print(Session().query(SearchWord).filter_by(word_insensitive="Trucks"))
     SELECT searchword.id AS searchword_id, searchword.word AS searchword_word
     FROM searchword
     WHERE lower(searchword.word) = :lower_1
@@ -588,12 +588,12 @@ SQL expression versus SQL expression::
 
     >>> sw1 = aliased(SearchWord)
     >>> sw2 = aliased(SearchWord)
-    >>> print Session().query(
+    >>> print(Session().query(
     ...                    sw1.word_insensitive,
     ...                    sw2.word_insensitive).\
     ...                        filter(
     ...                            sw1.word_insensitive > sw2.word_insensitive
-    ...                        )
+    ...                        ))
     SELECT lower(searchword_1.word) AS lower_1,
     lower(searchword_2.word) AS lower_2
     FROM searchword AS searchword_1, searchword AS searchword_2
@@ -606,7 +606,7 @@ Python only expression::
     True
     >>> ws1.word_insensitive == "XOmEwOrX"
     False
-    >>> print ws1.word_insensitive
+    >>> print(ws1.word_insensitive)
     someword
 
 The Hybrid Value pattern is very useful for any kind of value that may have
index e957bee7a6fe7f45d8f35e25f8164ea645d2c79f..bebf72a9d0d6a18b85de387982f3476009091113 100644 (file)
@@ -764,7 +764,7 @@ class ComparableProperty(DescriptorProperty):
         A mapping like the above allows the ``word_insensitive`` attribute
         to render an expression like::
 
-            >>> print SearchWord.word_insensitive == "Trucks"
+            >>> print(SearchWord.word_insensitive == "Trucks")
             lower(search_word.word) = lower(:lower_1)
 
         :param comparator_factory:
index 1a819777a82889c21e92cf061f24335eca377041..f0db1d86f804239dbfbf2d82100af9ba2c706027 100644 (file)
@@ -134,7 +134,7 @@ class InstanceEvents(event.Events):
         from sqlalchemy import event
 
         def my_load_listener(target, context):
-            print "on load!"
+            print("on load!")
 
         event.listen(SomeClass, 'load', my_load_listener)
 
@@ -1295,7 +1295,7 @@ class SessionEvents(event.Events):
         from sqlalchemy.orm import sessionmaker
 
         def my_before_commit(session):
-            print "before commit!"
+            print("before commit!")
 
         Session = sessionmaker()
 
index a99c6ca3567d460bfc4a2d57a58c9291be1cc61b..df690c383b861cb42b238480bec934b66e4c1568 100644 (file)
@@ -299,9 +299,9 @@ class ClauseElement(
         elements replaced with values taken from the given dictionary::
 
           >>> clause = column('x') + bindparam('foo')
-          >>> print clause.compile().params
+          >>> print(clause.compile().params)
           {'foo':None}
-          >>> print clause.params({'foo':7}).compile().params
+          >>> print(clause.params({'foo':7}).compile().params)
           {'foo':7}
 
         """
@@ -466,7 +466,7 @@ class ClauseElement(
 
                 s = select([t]).where(t.c.x == 5)
 
-                print s.compile(compile_kwargs={"literal_binds": True})
+                print(s.compile(compile_kwargs={"literal_binds": True}))
 
             .. versionadded:: 0.9.0
 
@@ -627,7 +627,7 @@ class ColumnElement(
         >>> from sqlalchemy.sql import column
         >>> column('a') + column('b')
         <sqlalchemy.sql.expression.BinaryExpression object at 0x101029dd0>
-        >>> print column('a') + column('b')
+        >>> print(column('a') + column('b'))
         a + b
 
     .. seealso::
@@ -1947,23 +1947,23 @@ class False_(roles.ConstExprRole, ColumnElement):
         E.g.::
 
             >>> from sqlalchemy import false
-            >>> print select([t.c.x]).where(false())
+            >>> print(select([t.c.x]).where(false()))
             SELECT x FROM t WHERE false
 
         A backend which does not support true/false constants will render as
         an expression against 1 or 0::
 
-            >>> print select([t.c.x]).where(false())
+            >>> print(select([t.c.x]).where(false()))
             SELECT x FROM t WHERE 0 = 1
 
         The :func:`.true` and :func:`.false` constants also feature
         "short circuit" operation within an :func:`.and_` or :func:`.or_`
         conjunction::
 
-            >>> print select([t.c.x]).where(or_(t.c.x > 5, true()))
+            >>> print(select([t.c.x]).where(or_(t.c.x > 5, true())))
             SELECT x FROM t WHERE true
 
-            >>> print select([t.c.x]).where(and_(t.c.x > 5, false()))
+            >>> print(select([t.c.x]).where(and_(t.c.x > 5, false())))
             SELECT x FROM t WHERE false
 
         .. versionchanged:: 0.9 :func:`.true` and :func:`.false` feature
@@ -2012,23 +2012,23 @@ class True_(roles.ConstExprRole, ColumnElement):
         E.g.::
 
             >>> from sqlalchemy import true
-            >>> print select([t.c.x]).where(true())
+            >>> print(select([t.c.x]).where(true()))
             SELECT x FROM t WHERE true
 
         A backend which does not support true/false constants will render as
         an expression against 1 or 0::
 
-            >>> print select([t.c.x]).where(true())
+            >>> print(select([t.c.x]).where(true()))
             SELECT x FROM t WHERE 1 = 1
 
         The :func:`.true` and :func:`.false` constants also feature
         "short circuit" operation within an :func:`.and_` or :func:`.or_`
         conjunction::
 
-            >>> print select([t.c.x]).where(or_(t.c.x > 5, true()))
+            >>> print(select([t.c.x]).where(or_(t.c.x > 5, true())))
             SELECT x FROM t WHERE true
 
-            >>> print select([t.c.x]).where(and_(t.c.x > 5, false()))
+            >>> print(select([t.c.x]).where(and_(t.c.x > 5, false())))
             SELECT x FROM t WHERE false
 
         .. versionchanged:: 0.9 :func:`.true` and :func:`.false` feature
@@ -3315,7 +3315,7 @@ class BinaryExpression(ColumnElement):
         >>> from sqlalchemy.sql import column
         >>> column('a') + column('b')
         <sqlalchemy.sql.expression.BinaryExpression object at 0x101029dd0>
-        >>> print column('a') + column('b')
+        >>> print(column('a') + column('b'))
         a + b
 
     """
index 137b1605a9757f0eb0314e4b3f963a521c23bc71..c1720b4c304aff09450e169f3b33ae2fc271aae0 100644 (file)
@@ -674,7 +674,7 @@ class GenericFunction(util.with_metaclass(_GenericMeta, Function)):
         class as_utc(GenericFunction):
             type = DateTime
 
-        print select([func.as_utc()])
+        print(select([func.as_utc()]))
 
     User-defined generic functions can be organized into
     packages by specifying the "package" attribute when defining
@@ -691,7 +691,7 @@ class GenericFunction(util.with_metaclass(_GenericMeta, Function)):
     The above function would be available from :data:`.func`
     using the package name ``time``::
 
-        print select([func.time.as_utc()])
+        print(select([func.time.as_utc()]))
 
     A final option is to allow the function to be accessed
     from one name in :data:`.func` but to render as a different name.
index b11e315ea56d392949d0ed97683f5b14189586af..b8d88e160e19fc2957652b0d514ecded8c984208 100644 (file)
@@ -3913,10 +3913,10 @@ class Select(
             >>> table1 = table('t1', column('a'), column('b'))
             >>> table2 = table('t2', column('a'), column('b'))
             >>> s1 = select([table1.c.a, table2.c.b])
-            >>> print s1
+            >>> print(s1)
             SELECT t1.a, t2.b FROM t1, t2
             >>> s2 = s1.with_only_columns([table2.c.b])
-            >>> print s2
+            >>> print(s2)
             SELECT t2.b FROM t1
 
         The preferred way to maintain a specific FROM clause
@@ -3928,7 +3928,7 @@ class Select(
             ...         select_from(table1.join(table2,
             ...                 table1.c.a==table2.c.a))
             >>> s2 = s1.with_only_columns([table2.c.b])
-            >>> print s2
+            >>> print(s2)
             SELECT t2.b FROM t1 JOIN t2 ON t1.a=t2.a
 
         Care should also be taken to use the correct
index 52b9fa1a9adb2bffe68188865d50fa43483ae973..22c80cc91ee6fda00dda3dd98da03fbf55b5bc95 100644 (file)
@@ -177,7 +177,7 @@ class String(Concatenable, TypeEngine):
           E.g.::
 
             >>> from sqlalchemy import cast, select, String
-            >>> print select([cast('some string', String(collation='utf8'))])
+            >>> print(select([cast('some string', String(collation='utf8'))]))
             SELECT CAST(:param_1 AS VARCHAR COLLATE utf8) AS anon_1
 
         :param convert_unicode: When set to ``True``, the