Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: Mel Newsgroups: comp.lang.python Subject: Re: Input() in Python3 Followup-To: comp.lang.python Date: Mon, 25 Apr 2011 12:50:50 -0400 Organization: Aioe.org NNTP Server Lines: 26 Message-ID: References: Reply-To: mwilson@the-wire.com NNTP-Posting-Host: VL41rB9YLO/FOFml4v1HWw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Complaints-To: abuse@aioe.org User-Agent: KNode/4.4.8 X-Notice: Filtered by postfilter v. 0.8.2 Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:3987 Westley Martínez wrote: > On Fri, Apr 22, 2011 at 10:08:20AM -0400, Mel wrote: [ ... ] >> But sys.exit() doesn't return a string. My fave is >> >> Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) >> [GCC 4.4.3] on linux2 >> Type "help", "copyright", "credits" or "license" for more information. >> >>> import sys >> >>> a = int (input ('enter a number >')) >> enter a number >sys.setrecursionlimit(1) >> Exception RuntimeError: 'maximum recursion depth exceeded while calling a >> Python object' in ignored [ ... ] > What? I guess sys.setrecursionlimit was meant to be called with a large number. Calling it with a small one roadblocks the interpreter. Luckily, there can be just enough room to call setrecursionlimit again with something reasonable to get it all back. Not enough room for `eval ("sys.setrecursionlimit (2000)`, though. Mel.