Path: csiph.com!usenet.pasdenom.info!news.etla.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.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.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'interpreter': 0.05; 'python3': 0.07; 'sys': 0.07; 'cc:addr:python-list': 0.11; 'python': 0.11; 'def': 0.12; 'jan': 0.12; '2.7.3': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'segfault': 0.16; 'wrote:': 0.18; 'code.': 0.18; '>>>': 0.22; 'import': 0.22; 'otherwise,': 0.22; 'cc:addr:python.org': 0.22; "shouldn't": 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'dec': 0.30; 'message-id:@mail.gmail.com': 0.30; 'skip:( 20': 0.30; 'code': 0.31; '13,': 0.31; "d'aprano": 0.31; 'fault': 0.31; 'shoot': 0.31; 'steven': 0.31; 'yes.': 0.31; 'linux': 0.33; 'except': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'pm,': 0.38; 'anything': 0.39; 'more': 0.64; 'mar': 0.68; 'yourself': 0.78; '2014,': 0.84; '2015': 0.84; 'willingly': 0.84; 'to:none': 0.92 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:cc :content-type; bh=hToCD9Xs1bJ2UeRYvuoiGznsSFL1s99roUcGTVf30bo=; b=pvPJlO2xW73X1Pw/hwe4ymnoCIFcnJZxlwANVBz8IFOl27zO3gxJ5TUyp8I1pHl1WC puP0ktWk60z3VGpavTdYRH8g29Gc6l4x+uK8QiR2Mk1wwHHl1fiQJhsAtoP2elM3zOQF Lxi51bIEFnChL45y+oCDDU1OW7Jp3HQ0JaVOvvx3uIUL8EZnV0XlbkWKib7g+ZIfkdqc 7yo44Ey3OMYEHayP5BMKRwNtppAcMZiHp2vTY7JCBpzMYF2R6KiwbLvDbHjePzwDXO5A YOlhQk2QysLk8nB2xfWnQzk2hdW/NPoqfz0xs/JeDoB1rh3UBTd5ClVXalo4TrVpCYrq JZCQ== MIME-Version: 1.0 X-Received: by 10.42.52.200 with SMTP id k8mr27119611icg.26.1421129632613; Mon, 12 Jan 2015 22:13:52 -0800 (PST) In-Reply-To: <54b4aded$0$2738$c3e8da3$76491128@news.astraweb.com> References: <54ABB88A.7070504@r3dsolutions.com> <54ABC52A.1050507@davea.name> <54ABE383.3020801@r3dsolutions.com> <54AC97D9.4010504@r3dsolutions.com> <54ACAA04.60801@r3dsolutions.com> <54ADC99F.3020405@stoneleaf.us> <54B44A64.7010105@r3dsolutions.com> <54b4aded$0$2738$c3e8da3$76491128@news.astraweb.com> Date: Tue, 13 Jan 2015 17:13:52 +1100 Subject: Re: Comparisons and sorting of a numeric class.... From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 29 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1421129635 news.xs4all.nl 2935 [2001:888:2000:d::a6]:32933 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:83665 On Tue, Jan 13, 2015 at 4:32 PM, Steven D'Aprano wrote: > Crashing the interpreter from > pure Python code is *absolutely not allowed*, so anything which would > allow that is forbidden. Except when you willingly shoot yourself in the foot. rosuav@sikorsky:~$ python Python 2.7.3 (default, Mar 13 2014, 11:03:55) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> def f(): sys.setrecursionlimit(sys.getrecursionlimit()+1) or f() ... >>> f() Segmentation fault rosuav@sikorsky:~$ python3 Python 3.5.0a0 (default:1c51f1650c42+, Dec 29 2014, 02:29:06) [GCC 4.7.2] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> def f(): sys.setrecursionlimit(sys.getrecursionlimit()+1) or f() ... >>> f() Segmentation fault But otherwise, yes. You shouldn't be able to segfault Python with Python code. ChrisA