Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!bloom-beacon.mit.edu!bloom-beacon.mit.edu!panix!not-for-mail From: Grant Edwards Newsgroups: comp.lang.python Subject: Re: Context-aware return Date: Thu, 10 Sep 2015 19:23:08 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 27 Message-ID: References: <55f1c3c6$0$1659$c3e8da3$5496439d@news.astraweb.com> NNTP-Posting-Host: 67-130-15-94.dia.static.qwest.net X-Trace: reader1.panix.com 1441912988 26088 67.130.15.94 (10 Sep 2015 19:23:08 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Thu, 10 Sep 2015 19:23:08 +0000 (UTC) User-Agent: slrn/1.0.2 (Linux) Xref: csiph.com comp.lang.python:96294 On 2015-09-10, Steven D'Aprano wrote: > I have a function which is intended for use at the interactive interpreter, > but may sometimes be used non-interactively. I wish to change it's output > depending on the context of how it is being called. [...] Sounds like an excellent way to waste somebody's afternoon when they start to troubleshoot code that's using your function. Over and over and over we tell newbies who have questions about what something returns or how it works "Start up an interactive session, and try it!". If word gets out about functions like yours, we sort of end up looking like twits. > If I did this thing, would people follow me down the street booing > and jeering and throwing things at me? Only the people who use your function. :) -- Grant Edwards grant.b.edwards Yow! FROZEN ENTREES may at be flung by members of gmail.com opposing SWANSON SECTS ...