diff options
| author | Jeffrey Finkelstein <jeffrey.finkelstein@gmail.com> | 2016-05-03 21:02:29 -0400 |
|---|---|---|
| committer | Jeffrey Finkelstein <jeffrey.finkelstein@gmail.com> | 2016-05-03 21:02:29 -0400 |
| commit | c31833e9973ef3b9fd4528e19eec0458bc8d51ee (patch) | |
| tree | 01f751348e4f7fcf7c73877e2cad324e102024da /doc/build/faq | |
| parent | 9a3c9ba7beb18dfd6232deb895528ea8593a12b0 (diff) | |
| download | sqlalchemy-pr/268.tar.gz | |
Adds parentheses around print statements in docs.pr/268
Diffstat (limited to 'doc/build/faq')
| -rw-r--r-- | doc/build/faq/metadata_schema.rst | 8 | ||||
| -rw-r--r-- | doc/build/faq/performance.rst | 2 | ||||
| -rw-r--r-- | doc/build/faq/sessions.rst | 6 |
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:: |
