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


Groups > comp.lang.python > #89937

Re: Bitten by my C/Java experience

Path csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <random832@fastmail.us>
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; 'python3': 0.07; 'received:internal': 0.09; 'subtle': 0.09; 'python': 0.11; 'def': 0.12; '(k,': 0.16; 'foo()': 0.16; 'kwargs': 0.16; 'message- id:@webmail.messagingengine.com': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:messagingengine.com': 0.16; 'repr': 0.16; 'set()': 0.16; 'set,': 0.16; 'subject:Java': 0.16; 'subtlety': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'example': 0.22; 'mon,': 0.24; 'subject:/': 0.26; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'andrew': 0.30; 'url:mailman': 0.30; 'consequence': 0.31; 'linux': 0.33; 'url:python': 0.33; 'received:66': 0.35; 'url:listinfo': 0.36; 'url:org': 0.36; 'received:10': 0.37; 'to:addr:python-list': 0.38; 'fact': 0.38; 'to:addr:python.org': 0.39; 'url:mail': 0.40; 'from:no real name:2**0': 0.61; "you've": 0.63; 'header:Message-Id:1': 0.63; 'more': 0.64; '2014,': 0.84; 'dict.': 0.84; 'subject:experience': 0.84
DKIM-Signature v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.us; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=cRMOjPpcdFkFdR26+MFT5I4Ccj4=; b=rP0Fl/ A0wulrd4bZKqppo7yNYEHydJPDMEKR+v9K5UBMKnUvwxKEKbo6p4ovX9NHcXsU7I HttcdEOdz2usJIvC0JPgP/oDxrNArbUo20dcHJd+Wy4dsCq0W4BiUiYsGGVxfbvp 37kRZ+GvnYdHCuDS4rCMTjg9dsUox4kQp2f4U=
DKIM-Signature v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=cRMOjPpcdFkFdR2 6+MFT5I4Ccj4=; b=q64BS0SMbbLdlwhlSxS/S4qUC6jcNdwjNonXDUb8iNqOZ2H WkaHnyDCXjn3LdZvGZuDHiVevXd1Uf+FYYuiw65l4pxBcdX7T2hXtZIkh4R9AgfB SzwxEimsjV8LVeOD+gw8HW36aExBP8/vXXptg8gObrvptWO7y6DQOS/R0zkI=
X-Sasl-Enc o+rEBACIVPkh5IF6p7JUSUWHXH1McgXN3SW2lBtAXF/e 1430774163
From random832@fastmail.us
To python-list@python.org
MIME-Version 1.0
Content-Transfer-Encoding 7bit
Content-Type text/plain
X-Mailer MessagingEngine.com Webmail Interface - ajax-f5f4dd6c
Subject Re: Bitten by my C/Java experience
Date Mon, 04 May 2015 17:16:03 -0400
In-Reply-To <mi8mf6$k1$1@flame.srcf.net>
References <87r3qwid3u.fsf@Equus.decebal.nl> <mailman.97.1430761463.12865.python-list@python.org> <mi8mf6$k1$1@flame.srcf.net>
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.106.1430774166.12865.python-list@python.org> (permalink)
Lines 33
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1430774166 news.xs4all.nl 2913 [2001:888:2000:d::a6]:54419
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:89937

Show key headers only | View raw


On Mon, May 4, 2015, at 16:57, Andrew Cooper wrote:
> * {} is an empty set(), not dict().

You've got it backwards.

> Particularly subtle when combined with **kwargs

The function in your example below _always_ returns a set, and kwargs is
always a dict. There's no subtlety outside of the repr output. The fact
that the empty set (as a result of empty kwargs) repr's as set() is a
consequence of the fact that {} is a dict.

> 
> $ python3
> Python 3.4.0 (default, Apr 11 2014, 13:05:11)
> [GCC 4.8.2] on linux
> Type "help", "copyright", "credits" or "license" for more information.
> >>> def foo(**kwargs):
> ...   return { (k, kwargs[k]) for k in kwargs }
> ...
> >>> foo()
> set()
> >>> foo(a=1)
> {('a', 1)}
> >>>
> 
> ~Andrew
> -- 
> https://mail.python.org/mailman/listinfo/python-list


-- 
Random832

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


Thread

Bitten by my C/Java experience Cecil Westerhof <Cecil@decebal.nl> - 2015-05-04 17:20 +0200
  Re: Bitten by my C/Java experience Tobiah <toby@tobiah.org> - 2015-05-04 10:18 -0700
  Re: Bitten by my C/Java experience Irmen de Jong <irmen.NOSPAM@xs4all.nl> - 2015-05-04 19:32 +0200
    Re: Bitten by my C/Java experience Chris Angelico <rosuav@gmail.com> - 2015-05-05 03:40 +1000
      Re: Bitten by my C/Java experience albert@spenarnc.xs4all.nl (Albert van der Horst) - 2015-05-08 10:47 +0000
        Re: Bitten by my C/Java experience Chris Angelico <rosuav@gmail.com> - 2015-05-08 21:32 +1000
  Re: Bitten by my C/Java experience Ian Kelly <ian.g.kelly@gmail.com> - 2015-05-04 11:43 -0600
    Re: Bitten by my C/Java experience Andrew Cooper <amc96@cam.ac.uk> - 2015-05-04 21:57 +0100
      Re: Bitten by my C/Java experience random832@fastmail.us - 2015-05-04 17:16 -0400
      Re: Bitten by my C/Java experience Tim Chase <python.list@tim.thechases.com> - 2015-05-04 16:26 -0500
  Re: Bitten by my C/Java experience Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-05-04 18:59 +0100
  Re: Bitten by my C/Java experience Ian Kelly <ian.g.kelly@gmail.com> - 2015-05-04 13:39 -0600
    Re: Bitten by my C/Java experience Cecil Westerhof <Cecil@decebal.nl> - 2015-05-04 22:28 +0200
      Re: Bitten by my C/Java experience Dave Angel <davea@davea.name> - 2015-05-04 19:17 -0400
  Re: Bitten by my C/Java experience Terry Reedy <tjreedy@udel.edu> - 2015-05-04 16:06 -0400
  Re: Bitten by my C/Java experience BartC <bc@freeuk.com> - 2015-05-04 23:02 +0100
    Re: Bitten by my C/Java experience Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-05-05 18:19 +1000
      Re: Bitten by my C/Java experience BartC <bc@freeuk.com> - 2015-05-05 14:20 +0100
        Re: Bitten by my C/Java experience Rustom Mody <rustompmody@gmail.com> - 2015-05-05 09:24 -0700
          Re: Bitten by my C/Java experience Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-05-06 14:38 +0200
            Re: Bitten by my C/Java experience Rustom Mody <rustompmody@gmail.com> - 2015-05-06 06:03 -0700
        Re: Bitten by my C/Java experience Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2015-05-06 23:19 +1200
          Re: Bitten by my C/Java experience BartC <bc@freeuk.com> - 2015-05-06 13:40 +0100
            Re: Bitten by my C/Java experience Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-05-07 02:03 +1000
              Re: Bitten by my C/Java experience Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-05-06 21:13 +0100
      Re: Bitten by my C/Java experience Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2015-05-06 23:15 +1200
    Re: Bitten by my C/Java experience random832@fastmail.us - 2015-05-06 09:11 -0400
    Re: Bitten by my C/Java experience Chris Angelico <rosuav@gmail.com> - 2015-05-06 23:16 +1000

csiph-web