summaryrefslogtreecommitdiff
path: root/doc/build/core
diff options
context:
space:
mode:
authorJeffrey Finkelstein <jeffrey.finkelstein@gmail.com>2016-05-03 21:02:29 -0400
committerJeffrey Finkelstein <jeffrey.finkelstein@gmail.com>2016-05-03 21:02:29 -0400
commitc31833e9973ef3b9fd4528e19eec0458bc8d51ee (patch)
tree01f751348e4f7fcf7c73877e2cad324e102024da /doc/build/core
parent9a3c9ba7beb18dfd6232deb895528ea8593a12b0 (diff)
downloadsqlalchemy-pr/268.tar.gz
Adds parentheses around print statements in docs.pr/268
Diffstat (limited to 'doc/build/core')
-rw-r--r--doc/build/core/connections.rst6
-rw-r--r--doc/build/core/custom_types.rst16
-rw-r--r--doc/build/core/event.rst4
-rw-r--r--doc/build/core/metadata.rst8
-rw-r--r--doc/build/core/pooling.rst2
-rw-r--r--doc/build/core/reflection.rst2
-rw-r--r--doc/build/core/tutorial.rst2
7 files changed, 20 insertions, 20 deletions
diff --git a/doc/build/core/connections.rst b/doc/build/core/connections.rst
index 709642ecf..5cdc5a3dd 100644
--- a/doc/build/core/connections.rst
+++ b/doc/build/core/connections.rst
@@ -48,7 +48,7 @@ way is first procure a connection resource, which you get via the
connection = engine.connect()
result = connection.execute("select username from users")
for row in result:
- print "username:", row['username']
+ print("username:", row['username'])
connection.close()
The connection is an instance of :class:`.Connection`,
@@ -76,7 +76,7 @@ The above procedure can be performed in a shorthand way by using the
result = engine.execute("select username from users")
for row in result:
- print "username:", row['username']
+ print("username:", row['username'])
Where above, the :meth:`~.Engine.execute` method acquires a new
:class:`.Connection` on its own, executes the statement with that object,
@@ -251,7 +251,7 @@ of :class:`.Engine`::
result = engine.execute("select username from users")
for row in result:
- print "username:", row['username']
+ print("username:", row['username'])
In addition to "connectionless" execution, it is also possible
to use the :meth:`~.Executable.execute` method of
diff --git a/doc/build/core/custom_types.rst b/doc/build/core/custom_types.rst
index f3a3b2bd0..3290e4dba 100644
--- a/doc/build/core/custom_types.rst
+++ b/doc/build/core/custom_types.rst
@@ -297,8 +297,8 @@ and use it in a :func:`.select` construct::
Column('geom_data', Geometry)
)
- print select([geometry]).where(
- geometry.c.geom_data == 'LINESTRING(189412 252431,189631 259122)')
+ print(select([geometry]).where(
+ geometry.c.geom_data == 'LINESTRING(189412 252431,189631 259122)'))
The resulting SQL embeds both functions as appropriate. ``ST_AsText``
is applied to the columns clause so that the return value is run through
@@ -315,7 +315,7 @@ with the labeling of the wrapped expression. Such as, if we rendered
a :func:`.select` against a :func:`.label` of our expression, the string
label is moved to the outside of the wrapped expression::
- print select([geometry.c.geom_data.label('my_data')])
+ print(select([geometry.c.geom_data.label('my_data')]))
Output::
@@ -361,10 +361,10 @@ transparently::
conn.execute(message.insert(), username="some user",
message="this is my message")
- print conn.scalar(
+ print(conn.scalar(
select([message.c.message]).\
where(message.c.username == "some user")
- )
+ ))
The ``pgp_sym_encrypt`` and ``pgp_sym_decrypt`` functions are applied
to the INSERT and SELECT statements::
@@ -425,7 +425,7 @@ associated with the :class:`.Integer` type.
Usage::
>>> sometable = Table("sometable", metadata, Column("data", MyInt))
- >>> print sometable.c.data + 5
+ >>> print(sometable.c.data + 5)
sometable.data goofy :data_1
The implementation for :meth:`.ColumnOperators.__add__` is consulted
@@ -452,7 +452,7 @@ to integers::
Using the above type::
- >>> print sometable.c.data.log(5)
+ >>> print(sometable.c.data.log(5))
log(:log_1, :log_2)
@@ -475,7 +475,7 @@ along with a :class:`.custom_op` to produce the factorial expression::
Using the above type::
>>> from sqlalchemy.sql import column
- >>> print column('x', MyInteger).factorial()
+ >>> print(column('x', MyInteger).factorial())
x !
See also:
diff --git a/doc/build/core/event.rst b/doc/build/core/event.rst
index ced81a6b2..1a81dbac1 100644
--- a/doc/build/core/event.rst
+++ b/doc/build/core/event.rst
@@ -30,7 +30,7 @@ and that a user-defined listener function should receive two positional argument
from sqlalchemy.pool import Pool
def my_on_connect(dbapi_con, connection_record):
- print "New DBAPI connection:", dbapi_con
+ print("New DBAPI connection:", dbapi_con)
listen(Pool, 'connect', my_on_connect)
@@ -41,7 +41,7 @@ To listen with the :func:`.listens_for` decorator looks like::
@listens_for(Pool, "connect")
def my_on_connect(dbapi_con, connection_record):
- print "New DBAPI connection:", dbapi_con
+ print("New DBAPI connection:", dbapi_con)
Named Argument Styles
---------------------
diff --git a/doc/build/core/metadata.rst b/doc/build/core/metadata.rst
index 24df3bc49..5052e0e7f 100644
--- a/doc/build/core/metadata.rst
+++ b/doc/build/core/metadata.rst
@@ -58,7 +58,7 @@ dependency (that is, each table is preceded by all tables which it
references)::
>>> for t in metadata.sorted_tables:
- ... print t.name
+ ... print(t.name)
user
user_preference
invoice
@@ -93,15 +93,15 @@ table include::
# iterate through all columns
for c in employees.c:
- print c
+ print(c)
# get the table's primary key columns
for primary_key in employees.primary_key:
- print primary_key
+ print(primary_key)
# get the table's foreign key objects:
for fkey in employees.foreign_keys:
- print fkey
+ print(fkey)
# access the table's MetaData:
employees.metadata
diff --git a/doc/build/core/pooling.rst b/doc/build/core/pooling.rst
index f9384fd60..2855d1a95 100644
--- a/doc/build/core/pooling.rst
+++ b/doc/build/core/pooling.rst
@@ -195,7 +195,7 @@ that they are replaced with new ones upon next checkout::
except exc.DBAPIError, e:
# an exception is raised, Connection is invalidated.
if e.connection_invalidated:
- print "Connection was invalidated!"
+ print("Connection was invalidated!")
# after the invalidate event, a new connection
# starts with a new Pool
diff --git a/doc/build/core/reflection.rst b/doc/build/core/reflection.rst
index 57389cbec..f70e3bec6 100644
--- a/doc/build/core/reflection.rst
+++ b/doc/build/core/reflection.rst
@@ -125,7 +125,7 @@ database is also available. This is known as the "Inspector"::
from sqlalchemy.engine import reflection
engine = create_engine('...')
insp = reflection.Inspector.from_engine(engine)
- print insp.get_table_names()
+ print(insp.get_table_names())
.. autoclass:: sqlalchemy.engine.reflection.Inspector
:members:
diff --git a/doc/build/core/tutorial.rst b/doc/build/core/tutorial.rst
index 0fd78abeb..043b537fc 100644
--- a/doc/build/core/tutorial.rst
+++ b/doc/build/core/tutorial.rst
@@ -1725,7 +1725,7 @@ like the above using the :meth:`.Select.lateral` method as follows::
>>> books = table('books', column('book_id'), column('owner_id'))
>>> subq = select([books.c.book_id]).\
... where(books.c.owner_id == people.c.people_id).lateral("book_subq")
- >>> print (select([people]).select_from(people.join(subq, true())))
+ >>> print(select([people]).select_from(people.join(subq, true())))
SELECT people.people_id, people.age, people.name
FROM people JOIN LATERAL (SELECT books.book_id AS book_id
FROM books WHERE books.owner_id = people.people_id)