Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

popen2.Popen3 class (Unix) documentation misleading / confusing #45932

Closed
mtomczak mannequin opened this issue Dec 11, 2007 · 2 comments
Closed

popen2.Popen3 class (Unix) documentation misleading / confusing #45932

mtomczak mannequin opened this issue Dec 11, 2007 · 2 comments
Assignees
Labels
docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error

Comments

@mtomczak
Copy link
Mannequin

mtomczak mannequin commented Dec 11, 2007

BPO 1591
Nosy @birkenfeld

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/birkenfeld'
closed_at = <Date 2008-01-06.14:34:54.053>
created_at = <Date 2007-12-11.17:12:04.182>
labels = ['type-bug', 'docs']
title = 'popen2.Popen3 class (Unix) documentation misleading / confusing'
updated_at = <Date 2008-01-06.14:34:54.051>
user = 'https://bugs.python.org/mtomczak'

bugs.python.org fields:

activity = <Date 2008-01-06.14:34:54.051>
actor = 'georg.brandl'
assignee = 'georg.brandl'
closed = True
closed_date = <Date 2008-01-06.14:34:54.053>
closer = 'georg.brandl'
components = ['Documentation']
creation = <Date 2007-12-11.17:12:04.182>
creator = 'mtomczak'
dependencies = []
files = []
hgrepos = []
issue_num = 1591
keywords = []
message_count = 2.0
messages = ['58440', '59376']
nosy_count = 2.0
nosy_names = ['georg.brandl', 'mtomczak']
pr_nums = []
priority = 'low'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue1591'
versions = ['Python 2.6', 'Python 2.5']

@mtomczak
Copy link
Mannequin Author

mtomczak mannequin commented Dec 11, 2007

The help documentation for the popen2.Popen3 class includes the
following information:

class Popen3
 |  Class representing a child process.  Normally instances are created
 |  by the factory functions popen2() and popen3().

This information is misleading because the function popen2.popen3
actually returns a tuple of file objects (child_stdout, child_stdin,
child_stderr), not an instance of class Popen3. Additionally, some of
the properties of class Popen3 are monkey-patched into the instance when
it is created and so do not appear in a dir(popen2.Popen3) call on the
class itself. This means that some automatic documentation generators
seem to fail to list these properties of the runtime Popen3 instance, as
they are not apparent in the class definition.

I suggest adding a note in the documentation of popen2.Popen3 to refer
users to the manual page http://docs.python.org/lib/popen3-objects.html.
An example of usage that takes into account the monkey-patched
properties would also be helpful.

@mtomczak mtomczak mannequin added docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error labels Dec 11, 2007
@birkenfeld birkenfeld self-assigned this Jan 6, 2008
@birkenfeld
Copy link
Member

I clarified the docstring in r59771. I won't extend it, however, since
most types don't announce their attributes in the docstring. For that
you should always consult the code or the official docs.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant