Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!81.171.88.16.MISMATCH!hq-usenetpeers.eweka.nl!hq-usenetpeers.eweka.nl!bcyclone01.am1.xlned.com!bcyclone01.am1.xlned.com!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'interpreter': 0.05; 'python3': 0.07; 'sys': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'def': 0.12; 'jan': 0.12; '1:13': 0.16; '2.7.3': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'segfault': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'import': 0.22; 'otherwise,': 0.22; 'header:User-Agent:1': 0.23; "shouldn't": 0.24; 'tracker': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'am,': 0.29; 'dec': 0.30; 'skip:( 20': 0.30; 'code': 0.31; '13,': 0.31; '>>>>': 0.31; 'crash': 0.31; "d'aprano": 0.31; 'fault': 0.31; 'shoot': 0.31; 'steven': 0.31; 'yes.': 0.31; 'linux': 0.33; 'could': 0.34; 'except': 0.35; 'but': 0.35; 'add': 0.35; 'there': 0.35; 'error.': 0.37; 'expected': 0.38; 'to:addr:python-list': 0.38; 'issue': 0.38; 'pm,': 0.38; 'anything': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'more': 0.64; 'mar': 0.68; 'yourself': 0.78; '2014,': 0.84; '2015': 0.84; 'received:fios.verizon.net': 0.84; 'willingly': 0.84; 'received:108': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Comparisons and sorting of a numeric class.... Date: Tue, 13 Jan 2015 05:49:22 -0500 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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-108-16-203-145.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 In-Reply-To: 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: 36 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1421146184 news.xs4all.nl 2905 [2001:888:2000:d::a6]:59012 X-Complaints-To: abuse@xs4all.nl X-Received-Body-CRC: 2211626601 X-Received-Bytes: 4881 Xref: csiph.com comp.lang.python:83681 On 1/13/2015 1:13 AM, Chris Angelico wrote: > 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. I would have expected an out-of-memory error. If there is not already a crash issue on the tracker for this, you could add one. -- Terry Jan Reedy