Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder1.xlned.com!newsfeed.xs4all.nl!newsfeed2.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.064 X-Spam-Evidence: '*H*': 0.87; '*S*': 0.00; 'perl,': 0.07; 'expression:': 0.09; 'moderator': 0.09; 'overflow': 0.09; 'thus,': 0.09; 'url:blog': 0.10; 'cc:addr:python-list': 0.11; 'python': 0.11; '"+"': 0.16; 'effect.': 0.16; 'in-place': 0.16; 'perl.': 0.16; 'unexpected': 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; 'wed,': 0.18; 'stack': 0.19; '>>>': 0.22; 'saying': 0.22; 'cc:addr:python.org': 0.22; "shouldn't": 0.24; 'cc:2**0': 0.24; 'source': 0.25; 'certain': 0.27; 'header:In-Reply-To:1': 0.27; 'rest': 0.29; 'am,': 0.29; 'compared': 0.30; 'matching': 0.30; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; '>>>>': 0.31; "d'aprano": 0.31; 'object.': 0.31; 'peterson': 0.31; 'steven': 0.31; 'url:06': 0.31; 'skip:m 30': 0.32; 'regular': 0.32; 'guess': 0.33; 'programmers': 0.33; 'copying': 0.34; 'problem': 0.35; 'problem.': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'add': 0.35; 'himself': 0.36; 'possible': 0.36; 'seconds': 0.37; 'too': 0.37; 'being': 0.38; 'anything': 0.39; 'url:01': 0.39; 'extremely': 0.39; 'changed': 0.39; 'expression': 0.60; 'solve': 0.60; 'new': 0.61; "you're": 0.61; 'first': 0.61; "you'll": 0.62; "you've": 0.63; 'july': 0.63; 'face': 0.64; 'skip:\xe2 10': 0.65; 'side': 0.67; 'design.': 0.68; 'sound': 0.68; 'subjectcharset:utf-8': 0.72; '8bit%:43': 0.74; 'jul': 0.74; 'cycles.': 0.84; 'ethan': 0.84; 'furman': 0.84; 'hate': 0.91; 'mistake': 0.91; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=EvR4dB5GhUpSa5Ht+vS8htOy9lawNbWRmmtDQGkbZR4=; b=Jo2cEvdN8OaoUaw+Q6gQEKKQt33mhlxCqVoevNogIXme5OXSSEfe2r7dkh+Gpb51K+ k1iB2q+kCaUM7aGl6pSOaIy9/uMRdJXfWMx03j9OLAHVC6OtZvP4ujgp9/o35xXHFfGK IcxXPDI9T7iRug4qvNc8RaxG5Z2DGvgIGQLk3PI8sV1N5IZdBPpqd8Vutr5YM7jCygJX Y+UY6ZvQriLxqI6L+esysZZZTce4Vi8ZwJQtOKrwBNlyFTXb/ACEj7ctvYcXS6kYoCa2 MhdtZPG/DT3VBG4nZTfe28/gE0YIji2HHhKb9LW/OhUlktYr5HyLamAsDvULBBn3S8kU ANSQ== X-Received: by 10.112.42.44 with SMTP id k12mr15524785lbl.63.1373478969566; Wed, 10 Jul 2013 10:56:09 -0700 (PDT) MIME-Version: 1.0 Sender: joshua.landau.ws@gmail.com In-Reply-To: <51DD8953.60709@stoneleaf.us> References: <51dd22a6$0$11094$c3e8da3@news.astraweb.com> <51DD8953.60709@stoneleaf.us> From: Joshua Landau Date: Wed, 10 Jul 2013 18:55:29 +0100 X-Google-Sender-Auth: g5sdmFOh0U7zWuUtqLEyXirH5xE Subject: =?UTF-8?Q?Re=3A_Stack_Overflow_moderator_=E2=80=9Canimuson=E2=80=9D?= To: Ethan Furman Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: python-list 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: 40 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1373478971 news.xs4all.nl 15989 [2001:888:2000:d::a6]:49931 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:50386 On 10 July 2013 17:18, Ethan Furman wrote: > On 07/10/2013 08:54 AM, Joshua Landau wrote: >> >> On 10 July 2013 10:00, Steven D'Aprano wrote: >>> >>> On Wed, 10 Jul 2013 07:55:05 +0000, Mats Peterson wrote: >>> >>>> A moderator who calls himself =E2=80=9Canimuson=E2=80=9D on Stack Over= flow doesn=E2=80=99t want >>>> to face the truth. He has deleted all my postings regarding Python >>>> regular expression matching being extremely slow compared to Perl. >>> >>> >>> That's by design. We don't want to make the same mistake as Perl, where >>> every problem is solved by a regular expression: >>> >>> >>> http://neilk.net/blog/2000/06/01/abigails-regex-to-test-for-prime-numbe= rs/ >>> >>> so we deliberately make regexes as slow as possible so that programmers >>> will look for a better way to solve their problem. If you check the >>> source code for the re engine, you'll find that for certain regexes, it >>> busy-waits for anything up to 30 seconds at a time, deliberately wastin= g >>> cycles. >> >> >> I hate to sound like this but do you realise that this is exactly what >> you're arguing for when saying that sum() shouldn't use "+=3D"? > > > my_obj =3D SomeKoolClass() > my_obj.modify_in_some_kool_way() > new_result =3D sum([SKC1, SKC2, SKC3], my_obj) > > Guess what? You've just changed my_obj. You're extrapolating too quickly. The first "+" is a copying "+", the rest add in-place to the new object. Thus, no unexpected side effect.