Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Doc/library/pipes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Template objects following methods:
arguments.


.. method:: Template.open(file, mode)
.. method:: Template.open(file, rw)

Return a file-like object, open to *file*, but read from or written to by the
pipeline. Note that only one of ``'r'``, ``'w'`` may be given.
Expand Down
4 changes: 2 additions & 2 deletions Lib/pipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
exit status of the conversion pipeline.
To open a file for reading or writing through a conversion pipeline:
fp = t.open(file, mode)
where mode is 'r' to read the file, or 'w' to write it -- just like
fp = t.open(file, rw)
where rw is 'r' to read the file, or 'w' to write it -- just like
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
where rw is 'r' to read the file, or 'w' to write it -- just like
where 'rw' is 'r' to read the file, or 'w' to write it -- just like

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I wonder if making it a string could be misleading - without quotes, it's clear that it's a variable of some sort, while with, maybe it gets confused as a value

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A compromise could be:

Suggested change
where rw is 'r' to read the file, or 'w' to write it -- just like
where *rw* is 'r' to read the file, or 'w' to write it -- just like

But the way @slateny has it currently is in keeping with the format used in the rest of the docstring: infile and outfile on line 46 are not surrounded by quotes or asterisks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah asterisks are a good idea, and good point on the consistency. I'm fine with both so I'll defer the choice here

for the built-in function open() or for os.popen().
To create a new template object initialized to a given one:
Expand Down