Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.016 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'interpreter': 0.05; 'subject:Python': 0.05; 'coders': 0.07; 'semantic': 0.07; 'tab': 0.07; 'python': 0.08; 'namespace': 0.09; 'files.': 0.09; 'displayed': 0.10; 'output': 0.10; 'deer': 0.16; 'docstrings': 0.16; 'induced': 0.16; 'react': 0.16; '>>>': 0.18; 'discussion': 0.22; 'header:In-Reply-To:1': 0.22; '\xa0if': 0.23; 'string': 0.24; 'cache': 0.24; 'code.': 0.26; 'stuff': 0.26; 'code': 0.26; 'function': 0.27; 'fact': 0.27; 'compare': 0.28; 'message- id:@mail.gmail.com': 0.29; 'class': 0.29; 'topic': 0.30; 'comments.': 0.30; 'received:209.85.210.46': 0.30; 'received:mail- pz0-f46.google.com': 0.30; 'useless': 0.30; 'usually': 0.31; 'do.': 0.31; 'does': 0.32; 'scientific': 0.32; 'typically': 0.32; 'sort': 0.33; 'there': 0.33; 'majority': 0.34; 'mostly': 0.34; 'doc': 0.34; 'function.': 0.34; 'probably': 0.35; 'to:addr:python- list': 0.35; 'something': 0.35; 'around.': 0.37; 'but': 0.37; 'received:google.com': 0.37; 'either': 0.37; 'received:209.85': 0.38; 'some': 0.38; 'format': 0.38; 'received:209': 0.39; 'called': 0.40; 'to:addr:python.org': 0.40; 'type': 0.61; 'double': 0.61; 'teach': 0.61; 'course,': 0.62; 'human': 0.62; 'journal': 0.67; 'designed': 0.69; 'paper': 0.72; 'completion': 0.82; 'analog': 0.84; 'fans,': 0.84; "program's": 0.84; '\xa0of': 0.84; 'abstracts': 0.91; 'medium.': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=n0nriu9Zdn/5TdkZia1+U+ymhMA0DtU0oZNP1qHWtk0=; b=zcr7UZGrdGHivIhS4CGmysRTnT8PGGG7dBfwxkAF0rfXy0os20PvpcHFeG2BSCWQOT b69mvGLmg6HAgk8IQoOplr8ZnH9/79D47sffUlYjaigjDRe8C2kPd1BHWUrg/0HDaD5B SGmCbRSvS04pbkq4vZq33kDzFLqGKmDz9v+8oKlGVemcxD7SmMHSeq/99yEVk+8k6D7G FI3kHWNOoRbMMc1+NxMDtiJZxz4TKK4B6kTJ2ZU07De0jr/fs93x4e56YgMsojVot4XD 4kpBFMH5G3L3rWvxmzHRqCH4qj2o+mrtSJYN0DcJGrycB1Dr7pVzUmj3cuUQ3IjJnVkT 7FTw== MIME-Version: 1.0 In-Reply-To: References: <4f612b19$0$1379$4fafbaef@reader2.news.tin.it> <8e72d74f-c844-4de3-8a37-f6b1fdc2291f@y27g2000yqy.googlegroups.com> <50e9ceec-40f1-4ead-b2b6-87328b30d084@ow8g2000pbc.googlegroups.com> Date: Tue, 20 Mar 2012 16:34:21 -0400 Subject: Re: Python is readable From: Nathan Rice To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 37 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1332275665 news.xs4all.nl 6957 [2001:888:2000:d::a6]:37378 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:21949 >>> The fact that scientific journal articles start with a documentation >>> string >>> called an abstract does not indicate that scientific English fails as a >>> human communication medium. Function docstrings say what the function >>> does >>> and how to use it without reading the code. They can be pulled out and >>> displayed elsewhere. They also guide the reading of the code. Abstracts >>> serve the same functions. >> >> >> A paper, with topic introduction, methods exposition, data/results >> description and discussion is a poor analog to a function. =A0I would >> compare the abstract of a scientific paper to the overview section of >> a program's documentation. =A0The great majority of the docstrings I see >> are basically signature rehashes with added type information and >> assertions, followed by a single sentence English gloss-over. =A0If the >> code were sufficiently intuitive and expressive, that would be >> redundant. =A0Of course, there will always be morbidly obese functions >> and coders that like to wax philosophical or give history lessons in >> comments. > > > Both abstracts and doc strings are designed to be and are read independen= tly > of the stuff they summarize. Perhaps you do not use help(obj) as often as > some other people do. I find help() to be mostly useless because of the clutter induced by double under methods. I use IPython, and I typically will either use tab name completion with the "?" feature or %edit if I really need to dig around. I teach Python to groups from time to time as part of my job, and I usually only mention help() as something of an afterthought, since typically people react to the output like a deer in headlights. Some sort of semantic function and class search from the interpreter would probably win a lot of fans, but I don't know that it is possible without a standard annotation format and the addition of a namespace cache to pyc files.