Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #49476

Stupid ways to spell simple code

Path csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.010
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'syntax': 0.04; 'inspired': 0.05; 'subject:code': 0.07; 'raises': 0.09; 'def': 0.12; 'abusing': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'nick': 0.16; 'stupid,': 0.16; 'subject:simple': 0.16; 'wrote:': 0.18; 'discussion': 0.18; 'bit': 0.19; "python's": 0.19; 'bonus': 0.22; 'function': 0.29; 'on,': 0.29; 'points': 0.29; 'raise': 0.29; 'message-id:@mail.gmail.com': 0.30; '>>>>': 0.31; 'could': 0.34; 'something': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'so,': 0.37; 'easily': 0.37; 'skip:[ 10': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'simple,': 0.60; 're:': 0.63; 'more': 0.64; '30,': 0.65; 'insane': 0.93; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=H+sT4dH4WBh75+Q+r9jY2YV+lGsYJZWDPCIMza60B8w=; b=tpPfPHFHS54tmL5NDE+5t4gkVMS+hDZJaNcWQSg6yfi/c0EdR2iacxxXOZ2ix6pAbi 4FdPOKNzIIJ1XMsknJqwQe6tkUpErSWszJdLFUXhqvljOCkDLNbn3jncOlpBBGt+SxU4 iu6mNSJtws2qXCTOJlauKr7sPf39AOpHJ9TNf7P0P8DxzkDV0n2Q7yF08HqysCPGNwB4 6P0CUvwjvWacpNDDXPPbNIPAXtcbbV15aGlt1Qkmc0EM7FhaAP5NeiDMWHfrjPFqakkZ Jlvl3HZuyrHt2ETT6Mf1G09W1+z/AGu5N4gWupRub8y7cgD/g9tgfP68BTQ7c+bMnU5H RJ6A==
MIME-Version 1.0
X-Received by 10.221.4.4 with SMTP id oa4mr7870428vcb.70.1372572395314; Sat, 29 Jun 2013 23:06:35 -0700 (PDT)
Date Sun, 30 Jun 2013 16:06:35 +1000
Subject Stupid ways to spell simple code
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.4021.1372572404.3114.python-list@python.org> (permalink)
Lines 21
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1372572404 news.xs4all.nl 15921 [2001:888:2000:d::a6]:33333
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:49476

Show key headers only | View raw


There's a bit of a discussion on python-ideas that includes a function
that raises StopIteration. It inspired me to do something stupid, just
to see how easily I could do it...

On Sun, Jun 30, 2013 at 3:45 PM, Nick Coghlan <ncoghlan@gmail.com> wrote:
Re: [Python-ideas] "Iteration stopping" syntax
>>>> def stop():
> ...     raise StopIteration

Here's a much more insane way to spell that:

stop = (lambda: 0 and (yield 1))().__next__

So, here's a challenge: Come up with something really simple, and
write an insanely complicated - yet perfectly valid - way to achieve
the same thing. Bonus points for horribly abusing Python's clean
syntax in the process.

Go on, do your worst!

ChrisA

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Stupid ways to spell simple code Chris Angelico <rosuav@gmail.com> - 2013-06-30 16:06 +1000
  Re: Stupid ways to spell simple code Rick Johnson <rantingrickjohnson@gmail.com> - 2013-06-30 07:58 -0700
    Re: Stupid ways to spell simple code Joshua Landau <joshua.landau.ws@gmail.com> - 2013-06-30 16:08 +0100
    Re: Stupid ways to spell simple code Chris Angelico <rosuav@gmail.com> - 2013-07-01 01:20 +1000
    Re: Stupid ways to spell simple code Ian Kelly <ian.g.kelly@gmail.com> - 2013-06-30 11:26 -0600
  Re: Stupid ways to spell simple code Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-30 17:36 +0000
    Re: Stupid ways to spell simple code Roy Smith <roy@panix.com> - 2013-06-30 13:44 -0400
    Re: Stupid ways to spell simple code Joshua Landau <joshua.landau.ws@gmail.com> - 2013-06-30 22:52 +0100
  Re: Stupid ways to spell simple code Neil Cerutti <neilc@norwich.edu> - 2013-07-01 12:59 +0000
    Re: Stupid ways to spell simple code Chris Angelico <rosuav@gmail.com> - 2013-07-01 23:14 +1000
    Re: Stupid ways to spell simple code Joshua Landau <joshua.landau.ws@gmail.com> - 2013-07-01 17:30 +0100
    Re: Stupid ways to spell simple code Marcin Szamotulski <mszamot@gmail.com> - 2013-07-01 20:36 +0100
      Re: Stupid ways to spell simple code Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-07-01 22:09 +0000
        Re: Stupid ways to spell simple code 88888 Dihedral <dihedral88888@gmail.com> - 2013-07-01 21:16 -0700
        Re: Stupid ways to spell simple code Marcin Szamotulski <mszamot@gmail.com> - 2013-07-02 07:22 +0100
    Re: Stupid ways to spell simple code Chris Angelico <rosuav@gmail.com> - 2013-07-02 02:32 +1000
  Re: Stupid ways to spell simple code Russel Walker <russ.pobox@gmail.com> - 2013-07-02 00:33 -0700

csiph-web