summaryrefslogtreecommitdiff
path: root/doc/build/faq
diff options
context:
space:
mode:
Diffstat (limited to 'doc/build/faq')
-rw-r--r--doc/build/faq/metadata_schema.rst8
-rw-r--r--doc/build/faq/performance.rst2
-rw-r--r--doc/build/faq/sessions.rst6
3 files changed, 8 insertions, 8 deletions
diff --git a/doc/build/faq/metadata_schema.rst b/doc/build/faq/metadata_schema.rst
index 9697399dc..7e4a55720 100644
--- a/doc/build/faq/metadata_schema.rst
+++ b/doc/build/faq/metadata_schema.rst
@@ -64,7 +64,7 @@ This is available via the :attr:`.MetaData.sorted_tables` function::
# ... add Table objects to metadata
ti = metadata.sorted_tables:
for t in ti:
- print t
+ print(t)
How can I get the CREATE TABLE/ DROP TABLE output as a string?
===========================================================================
@@ -74,17 +74,17 @@ can be rendered to strings like any other SQL expression::
from sqlalchemy.schema import CreateTable
- print CreateTable(mytable)
+ print(CreateTable(mytable))
To get the string specific to a certain engine::
- print CreateTable(mytable).compile(engine)
+ print(CreateTable(mytable).compile(engine))
There's also a special form of :class:`.Engine` that can let you dump an entire
metadata creation sequence, using this recipe::
def dump(sql, *multiparams, **params):
- print sql.compile(dialect=engine.dialect)
+ print(sql.compile(dialect=engine.dialect))
engine = create_engine('postgresql://', strategy='mock', executor=dump)
metadata.create_all(engine, checkfirst=False)
diff --git a/doc/build/faq/performance.rst b/doc/build/faq/performance.rst
index 8413cb5a2..21fae654b 100644
--- a/doc/build/faq/performance.rst
+++ b/doc/build/faq/performance.rst
@@ -104,7 +104,7 @@ Below is a simple recipe which works profiling into a context manager::
ps.print_stats()
# uncomment this to see who's calling what
# ps.print_callers()
- print s.getvalue()
+ print(s.getvalue())
To profile a section of code::
diff --git a/doc/build/faq/sessions.rst b/doc/build/faq/sessions.rst
index 8a47db77a..ee280ae98 100644
--- a/doc/build/faq/sessions.rst
+++ b/doc/build/faq/sessions.rst
@@ -282,11 +282,11 @@ one::
class Iterates(object):
def __len__(self):
- print "LEN!"
+ print("LEN!")
return 5
def __iter__(self):
- print "ITER!"
+ print("ITER!")
return iter([1, 2, 3, 4, 5])
list(Iterates())
@@ -477,7 +477,7 @@ The function can be demonstrated as follows::
for obj in walk(a1):
- print obj
+ print(obj)
Output::