Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #107906
| Path | csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | Random832 <random832@fastmail.com> |
| Newsgroups | comp.lang.python |
| Subject | Re: What should Python apps do when asked to show help? |
| Date | Sat, 30 Apr 2016 01:20:11 -0400 |
| Lines | 46 |
| Message-ID | <mailman.257.1461993614.32212.python-list@python.org> (permalink) |
| References | <57223b76$0$22140$c3e8da3$5496439d@news.astraweb.com> <877ffhgnyf.fsf@nightsong.com> <0d5b5562-7a08-41de-8b84-a13f0792e767@googlegroups.com> <57232b34$0$1595$c3e8da3$5496439d@news.astraweb.com> <72444f12-784b-47b4-a80c-0ae53cf3b5a3@googlegroups.com> <57240856$0$1590$c3e8da3$5496439d@news.astraweb.com> <572413C9.2070405@stoneleaf.us> <1461982612.3299155.593966809.3D1A53FF@webmail.messagingengine.com> <mailman.245.1461982615.32212.python-list@python.org> <41ec5af0-2ffa-4202-a5df-08f9660f7c57@googlegroups.com> <1461983791.3302675.593974129.5625C3C3@webmail.messagingengine.com> <85bn4rizf3.fsf@benfinney.id.au> <mailman.252.1461984570.32212.python-list@python.org> <5724253e$0$22142$c3e8da3$5496439d@news.astraweb.com> <1461993611.3340362.594023513.1E745BA1@webmail.messagingengine.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain |
| Content-Transfer-Encoding | 7bit |
| X-Trace | news.uni-berlin.de WtZD0+7uR1ob+D0kUTHrXgLAFeSzoMgeX0Yc8X/iOliA== |
| Return-Path | <random832@fastmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.000 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'subject:Python': 0.05; 'wrapper': 0.07; 'subject:help': 0.07; 'behave': 0.09; 'cached': 0.09; 'default:': 0.09; 'fallback.': 0.09; 'logic': 0.09; 'received:internal': 0.09; 'subsequently': 0.09; 'stored': 0.10; 'itself.': 0.11; 'output': 0.13; 'argument': 0.15; 'importing': 0.15; 'skip:f 30': 0.15; '"use': 0.16; 'lambda': 0.16; 'message-id:@webmail.messagingengine.com': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:10.202.2.212': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:io': 0.16; 'received:messagingengine.com': 0.16; 'received:psf.io': 0.16; 'stuff,': 0.16; 'subject:show': 0.16; 'subject:when': 0.16; 'thoughts?': 0.16; 'ttys,': 0.16; 'unix-style': 0.16; 'wrote:': 0.16; 'passes': 0.18; '(in': 0.18; 'windows': 0.20; 'function,': 0.22; 'replacing': 0.23; 'somewhere': 0.24; 'written': 0.24; 'header:In-Reply-To:1': 0.24; 'testing': 0.25; "doesn't": 0.26; 'external': 0.27; '(e.g.': 0.27; 'fri,': 0.27; 'module.': 0.27; 'function': 0.28; 'for,': 0.29; 'value)': 0.29; "i'm": 0.30; "we're": 0.30; "i'd": 0.31; 'probably': 0.31; 'another': 0.32; 'embedded': 0.32; 'expensive': 0.32; 'useful': 0.33; "d'aprano": 0.33; 'purposes,': 0.33; 'steven': 0.33; 'handle': 0.34; 'gives': 0.35; 'could': 0.35; 'text': 0.35; 'generic': 0.35; 'text.': 0.35; 'something': 0.35; 'asking': 0.35; 'should': 0.36; 'keyword': 0.36; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'received:66': 0.38; 'stuff': 0.38; 'skip:o 20': 0.38; 'test': 0.39; 'rather': 0.39; 'to:addr:python.org': 0.40; 'called': 0.40; 'your': 0.60; 'behavior': 0.61; 'header:Message-Id:1': 0.61; 'improved': 0.63; 'more': 0.63; 'elsewhere': 0.66; 'where:': 0.66; 'seriously,': 0.91 |
| DKIM-Signature | v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=ECdYPaGswGfiaBkK1WQePVYmCWA=; b=us9twh vSHp3FaBOuLISAgjLKQaB7M2Rmnz3LEnfe+reUdkifhxuTW8O4m6McOUm9yihCRd oJiWCSFNo+EWrfcIOYg6gwDBlRjc5LDIYY5W9OQz6lPkt9NRT1RcfO21UZHvm7UF kSXc0hD7HopAvYc20o87E1FAgg444PoeY2Jls= |
| DKIM-Signature | v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=ECdYPaGswGfiaBk K1WQePVYmCWA=; b=DD1QDftbXws+BxWP4UF36jX5mjKavB4P5mpI9IDxFo6Qooc 7Eav7mamK9Z/t1ydkZiLcRERdyBU3vIbDbKRJnRvAVqd/dj3AJICkL+vRXbuJGUD DusLDP0ozS4m3r+NJ8LS7YDH4qW6TC1ldgsolCnik0GJoEiTHSnubk7maRNs= |
| X-Sasl-Enc | K1qX3/2W3XRrVgdfpqQzonobu5+vD1GUd5zMJkcMMHY0 1461993611 |
| X-Mailer | MessagingEngine.com Webmail Interface - ajax-491eb5a4 |
| In-Reply-To | <5724253e$0$22142$c3e8da3$5496439d@news.astraweb.com> |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.22 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| X-Mailman-Original-Message-ID | <1461993611.3340362.594023513.1E745BA1@webmail.messagingengine.com> |
| X-Mailman-Original-References | <57223b76$0$22140$c3e8da3$5496439d@news.astraweb.com> <877ffhgnyf.fsf@nightsong.com> <0d5b5562-7a08-41de-8b84-a13f0792e767@googlegroups.com> <57232b34$0$1595$c3e8da3$5496439d@news.astraweb.com> <72444f12-784b-47b4-a80c-0ae53cf3b5a3@googlegroups.com> <57240856$0$1590$c3e8da3$5496439d@news.astraweb.com> <572413C9.2070405@stoneleaf.us> <1461982612.3299155.593966809.3D1A53FF@webmail.messagingengine.com> <mailman.245.1461982615.32212.python-list@python.org> <41ec5af0-2ffa-4202-a5df-08f9660f7c57@googlegroups.com> <1461983791.3302675.593974129.5625C3C3@webmail.messagingengine.com> <85bn4rizf3.fsf@benfinney.id.au> <mailman.252.1461984570.32212.python-list@python.org> <5724253e$0$22142$c3e8da3$5496439d@news.astraweb.com> |
| Xref | csiph.com comp.lang.python:107906 |
Show key headers only | View raw
On Fri, Apr 29, 2016, at 23:23, Steven D'Aprano wrote: > Seriously, I'm thinking that a keyword argument to help might be useful: > > help(object, pager=None) I'd call it something more generic like "output". > where: > > - pager=None gives the current behaviour; > > - pager="foo" calls out to the external program "foo"; > > - pager=callable passes the help text to callable(). > > > pager=print would do exactly what people are asking for, and you could > then > create your own wrapper to change the default: > > help = functools.partial(builtins.help, pager=print) > > > I think that would make it easier to test help(). Thoughts? For testing purposes, help could return the result of the output function, so that you can use lambda x: x to have it return the help text. More general thoughts: It might also be useful to move the pager machinery from pydoc to an independent module. It's got, among other things, a simple pager written in pure python, for use as a fallback. There's a lot of stuff that could be improved in the pager stuff, while we're at it. Probably needs a single function to handle "use external program as a pager", rather than having a bunch of logic embedded in getpager() which only works for os.environ['PAGER']. The "pager" function doesn't behave "properly" (in its intended behavior of calling the expensive getpager() once when it is first called and subsequently reusing the cached value) if a reference to it is stored elsewhere (e.g. by importing it to another module); it should store the cached pager function somewhere else rather than by replacing itself. The pure-python pager only works on unix-style ttys, an analogous function could be written for windows using msvcrt.getwch.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
What should Python apps do when asked to show help? Steven D'Aprano <steve@pearwood.info> - 2016-04-29 02:33 +1000
Re: What should Python apps do when asked to show help? alister <alister.ware@ntlworld.com> - 2016-04-28 16:45 +0000
RE: What should Python apps do when asked to show help? Dan Strohl <D.Strohl@F5.com> - 2016-04-28 17:02 +0000
Re: What should Python apps do when asked to show help? John Wong <gokoproject@gmail.com> - 2016-04-28 13:05 -0400
RE: What should Python apps do when asked to show help? Dan Strohl <D.Strohl@F5.com> - 2016-04-28 17:25 +0000
Re: What should Python apps do when asked to show help? Ethan Furman <ethan@stoneleaf.us> - 2016-04-28 10:27 -0700
Re: What should Python apps do when asked to show help? Ethan Furman <ethan@stoneleaf.us> - 2016-04-28 09:49 -0700
Re: What should Python apps do when asked to show help? Chris Angelico <rosuav@gmail.com> - 2016-04-29 03:06 +1000
Re: What should Python apps do when asked to show help? Irmen de Jong <irmen.NOSPAM@xs4all.nl> - 2016-04-28 19:08 +0200
Re: What should Python apps do when asked to show help? Marko Rauhamaa <marko@pacujo.net> - 2016-04-28 20:31 +0300
Re: What should Python apps do when asked to show help? Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2016-04-29 18:04 +1200
RE: What should Python apps do when asked to show help? Dan Strohl <D.Strohl@F5.com> - 2016-04-28 17:32 +0000
Re: What should Python apps do when asked to show help? Jussi Piitulainen <jussi.piitulainen@helsinki.fi> - 2016-04-28 20:30 +0300
Re: What should Python apps do when asked to show help? Random832 <random832@fastmail.com> - 2016-04-28 13:30 -0400
Re: What should Python apps do when asked to show help? Grant Edwards <grant.b.edwards@gmail.com> - 2016-04-28 17:33 +0000
RE: What should Python apps do when asked to show help? Dan Strohl <D.Strohl@F5.com> - 2016-04-28 17:39 +0000
Re: What should Python apps do when asked to show help? Random832 <random832@fastmail.com> - 2016-04-28 13:40 -0400
Re: What should Python apps do when asked to show help? Grant Edwards <grant.b.edwards@gmail.com> - 2016-04-28 18:14 +0000
Re: What should Python apps do when asked to show help? Marko Rauhamaa <marko@pacujo.net> - 2016-04-28 21:31 +0300
Re: What should Python apps do when asked to show help? Grant Edwards <grant.b.edwards@gmail.com> - 2016-04-28 19:39 +0000
Re: What should Python apps do when asked to show help? Random832 <random832@fastmail.com> - 2016-04-28 15:51 -0400
Re: What should Python apps do when asked to show help? Grant Edwards <grant.b.edwards@gmail.com> - 2016-04-28 21:08 +0000
Re: What should Python apps do when asked to show help? Steven D'Aprano <steve@pearwood.info> - 2016-04-29 11:40 +1000
manpage writing [rst, asciidoc, pod] was [Re: What should Python apps do when asked to show help?] "Martin A. Brown" <martin@linux-ip.net> - 2016-04-29 06:32 -0700
Re: manpage writing [rst, asciidoc, pod] was [Re: What should Python apps do when asked to show help?] Ethan Furman <ethan@stoneleaf.us> - 2016-04-29 07:06 -0700
Re: manpage writing [rst, asciidoc, pod] was [Re: What should Python apps do when asked to show help?] Rustom Mody <rustompmody@gmail.com> - 2016-04-29 08:17 -0700
Re: manpage writing [rst, asciidoc, pod] was [Re: What should Python apps do when asked to show help?] Ben Finney <ben+python@benfinney.id.au> - 2016-04-30 12:25 +1000
Re: manpage writing [rst, asciidoc, pod] was [Re: What should Python apps do when asked to show help?] Rustom Mody <rustompmody@gmail.com> - 2016-04-29 20:20 -0700
Re: manpage writing [rst, asciidoc, pod] was [Re: What should Python apps do when asked to show help?] Paul Rubin <no.email@nospam.invalid> - 2016-04-29 21:06 -0700
Re: manpage writing [rst, asciidoc, pod] was [Re: What should Python apps do when asked to show help?] Rustom Mody <rustompmody@gmail.com> - 2016-04-29 23:37 -0700
Re: manpage writing [rst, asciidoc, pod] was [Re: What should Python apps do when asked to show help?] Paul Rubin <no.email@nospam.invalid> - 2016-04-30 00:44 -0700
Writing manual pages using Python code (was: manpage writing) Ben Finney <ben+python@benfinney.id.au> - 2016-04-30 12:25 +1000
Re: What should Python apps do when asked to show help? cs@zip.com.au - 2016-05-01 10:06 +1000
Re: What should Python apps do when asked to show help? Paul Rubin <no.email@nospam.invalid> - 2016-04-28 19:15 -0700
Re: What should Python apps do when asked to show help? Rustom Mody <rustompmody@gmail.com> - 2016-04-28 22:00 -0700
Re: What should Python apps do when asked to show help? Jussi Piitulainen <jussi.piitulainen@helsinki.fi> - 2016-04-29 09:02 +0300
Re: What should Python apps do when asked to show help? Steven D'Aprano <steve@pearwood.info> - 2016-04-29 19:36 +1000
Re: What should Python apps do when asked to show help? Rustom Mody <rustompmody@gmail.com> - 2016-04-29 02:53 -0700
Re: What should Python apps do when asked to show help? Steven D'Aprano <steve@pearwood.info> - 2016-04-30 11:20 +1000
Re: What should Python apps do when asked to show help? Ethan Furman <ethan@stoneleaf.us> - 2016-04-29 19:09 -0700
Re: What should Python apps do when asked to show help? Random832 <random832@fastmail.com> - 2016-04-29 22:16 -0400
Re: What should Python apps do when asked to show help? Rustom Mody <rustompmody@gmail.com> - 2016-04-29 19:27 -0700
Re: What should Python apps do when asked to show help? Random832 <random832@fastmail.com> - 2016-04-29 22:36 -0400
Re: What should Python apps do when asked to show help? Rustom Mody <rustompmody@gmail.com> - 2016-04-29 19:46 -0700
Re: What should Python apps do when asked to show help? Random832 <random832@fastmail.com> - 2016-04-29 23:14 -0400
Re: What should Python apps do when asked to show help? Ben Finney <ben+python@benfinney.id.au> - 2016-04-30 12:49 +1000
Re: What should Python apps do when asked to show help? Steven D'Aprano <steve@pearwood.info> - 2016-04-30 13:23 +1000
Re: What should Python apps do when asked to show help? Ben Finney <ben+python@benfinney.id.au> - 2016-04-30 14:06 +1000
Re: What should Python apps do when asked to show help? Random832 <random832@fastmail.com> - 2016-04-30 00:16 -0400
Re: What should Python apps do when asked to show help? Rustom Mody <rustompmody@gmail.com> - 2016-04-29 21:34 -0700
Re: What should Python apps do when asked to show help? Random832 <random832@fastmail.com> - 2016-04-30 01:20 -0400
Re: What should Python apps do when asked to show help? cs@zip.com.au - 2016-05-01 09:51 +1000
Re: What should Python apps do when asked to show help? Steven D'Aprano <steve@pearwood.info> - 2016-05-01 14:28 +1000
Re: What should Python apps do when asked to show help? Random832 <random832@fastmail.com> - 2016-04-30 20:41 -0400
Re: What should Python apps do when asked to show help? Grant Edwards <grant.b.edwards@gmail.com> - 2016-05-01 02:30 +0000
Re: What should Python apps do when asked to show help? Random832 <random832@fastmail.com> - 2016-04-30 23:46 -0400
csiph-web