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


Groups > comp.lang.python > #97105

Re: Idiosyncratic python

Path csiph.com!au2pb.net!feeder.erje.net!1.eu.feeder.erje.net!ecngs!feeder2.ecngs.de!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.025
X-Spam-Evidence '*H*': 0.95; '*S*': 0.00; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'example:': 0.10; 'python': 0.10; 'python.': 0.11; 'subject:python': 0.14; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'wrote:': 0.16; 'hack': 0.18; 'lawrence': 0.22; 'seems': 0.23; "i've": 0.25; 'header:User- Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'least': 0.27; 'looks': 0.29; 'correct,': 0.29; "i'm": 0.30; 'print': 0.30; 'code': 0.30; "d'aprano": 0.33; 'int': 0.33; 'steven': 0.33; 'message-id:@gmail.com': 0.34; 'worked': 0.34; 'something': 0.35; 'but': 0.36; 'too': 0.36; 'instead': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'sure': 0.39; 'rather': 0.39; 'to:addr:python.org': 0.40; 'mark': 0.40; 'your': 0.60; "you'll": 0.61; 'ago.': 0.61; 'today,': 0.62; 'more': 0.63; 'enjoy': 0.66; 'obvious': 0.76; 'received:89': 0.80; 'like:-': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Akira Li <4kir4.1i@gmail.com>
Subject Re: Idiosyncratic python
Date Fri, 25 Sep 2015 03:04:04 +0300
References <560391ea$0$2885$c3e8da3$76491128@news.astraweb.com> <mu21lc$4cl$1@ger.gmane.org>
Mime-Version 1.0
Content-Type text/plain
X-Gmane-NNTP-Posting-Host 89.169.229.68
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)
Cancel-Lock sha1:8mgFI1LCHxaSfuDLWm4iq7ZEKow=
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.156.1443139449.28679.python-list@python.org> (permalink)
Lines 36
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1443139449 news.xs4all.nl 23797 [2001:888:2000:d::a6]:40905
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:97105

Show key headers only | View raw


Mark Lawrence <breamoreboy@yahoo.co.uk> writes:

> On 24/09/2015 07:02, Steven D'Aprano wrote:
>> I was looking at an in-house code base today, and the author seems to have a
>> rather idiosyncratic approach to Python. For example:
>>
>> for k, v in mydict.items():
>>      del(k)
>>      ...
>>
>> instead of the more obvious
>>
>> for v in mydict.values():
>>      ...
>>
>> What are your favorite not-wrong-just-weird Python moments?
>>
>
> My favourite was from a guy I worked with years ago.  In C but I'm
> sure you'll enjoy it.  In all functions, something like:-
>
> int flag = 0;
> if flag {
>     printf("\nthe string");
> }
> else{
>     printf("the string");
>     flag = 1;
> }
>
> At least I think I've got it correct, too lazy to check, sorry :)

It looks like a sys.stdout.softspace hack in Python 2:

  print line, # comma!

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


Thread

Idiosyncratic python Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-09-24 16:02 +1000
  Re: Idiosyncratic python Paul Rubin <no.email@nospam.invalid> - 2015-09-23 23:16 -0700
    Re: Idiosyncratic python Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-09-24 16:35 +1000
      Re: Idiosyncratic python Ben Finney <ben+python@benfinney.id.au> - 2015-09-24 16:54 +1000
        Re: Idiosyncratic python Steven D'Aprano <steve@pearwood.info> - 2015-09-25 11:08 +1000
      Re: Idiosyncratic python Terry Reedy <tjreedy@udel.edu> - 2015-09-24 02:54 -0400
  Re: Idiosyncratic python wxjmfauth@gmail.com - 2015-09-24 00:06 -0700
    Re: Idiosyncratic python Laurent Pointal <laurent.pointal@free.fr> - 2015-09-24 19:50 +0200
      Re: Idiosyncratic python Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-09-24 21:05 +0100
  Re: Idiosyncratic python jmp <jeanmichel@sequans.com> - 2015-09-24 11:12 +0200
  Re: Idiosyncratic python Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-09-24 14:09 +0100
  Re: Idiosyncratic python jmp <jeanmichel@sequans.com> - 2015-09-24 16:07 +0200
  Re: Idiosyncratic python Ian Kelly <ian.g.kelly@gmail.com> - 2015-09-24 08:26 -0600
  Re: Idiosyncratic python Chris Angelico <rosuav@gmail.com> - 2015-09-25 02:57 +1000
  Re: Idiosyncratic python jmp <jeanmichel@sequans.com> - 2015-09-24 20:04 +0200
  Re: Idiosyncratic python Ian Kelly <ian.g.kelly@gmail.com> - 2015-09-24 12:19 -0600
  Re: Idiosyncratic python Ned Batchelder <ned@nedbatchelder.com> - 2015-09-24 13:46 -0700
    Re: Idiosyncratic python Laura Creighton <lac@openend.se> - 2015-09-24 23:08 +0200
    Re: Idiosyncratic python Chris Angelico <rosuav@gmail.com> - 2015-09-25 07:49 +1000
    Re: Idiosyncratic python Steven D'Aprano <steve@pearwood.info> - 2015-09-25 10:55 +1000
  Re: Idiosyncratic python sohcahtoa82@gmail.com - 2015-09-24 15:32 -0700
  Re: Idiosyncratic python Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-09-25 00:40 +0100
  Re: Idiosyncratic python Akira Li <4kir4.1i@gmail.com> - 2015-09-25 03:04 +0300
  Re: Idiosyncratic python Steven D'Aprano <steve@pearwood.info> - 2015-09-25 10:08 +1000

csiph-web