summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/elements.py
diff options
context:
space:
mode:
authorAlbert Tugushev <albert@tugushev.ru>2020-02-26 11:09:29 -0500
committersqla-tester <sqla-tester@sqlalchemy.org>2020-02-26 11:09:29 -0500
commita836e3df5d973f75bd8330cecb76511b67c13612 (patch)
tree6c2e6de399ad90f49112bb5fecc02ae99c651a63 /lib/sqlalchemy/sql/elements.py
parente15c53716b9f59c7c666c77d1e8b8d82538036a3 (diff)
downloadsqlalchemy-a836e3df5d973f75bd8330cecb76511b67c13612.tar.gz
Remove print statement in favor of print() function in docs and examples
<!-- 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
Diffstat (limited to 'lib/sqlalchemy/sql/elements.py')
-rw-r--r--lib/sqlalchemy/sql/elements.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/sqlalchemy/sql/elements.py b/lib/sqlalchemy/sql/elements.py
index a99c6ca35..df690c383 100644
--- a/lib/sqlalchemy/sql/elements.py
+++ b/lib/sqlalchemy/sql/elements.py
@@ -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
"""