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


Groups > comp.lang.python > #10482

Re: NoneType and new instances

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.027
X-Spam-Evidence '*H*': 0.95; '*S*': 0.00; 'am,': 0.13; 'wrote:': 0.15; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'lambda': 0.16; 'def': 0.16; 'received:209.85.210.174': 0.19; 'received:mail-iy0-f174.google.com': 0.19; 'header:In-Reply-To:1': 0.22; "shouldn't": 0.23; 'pass': 0.28; 'fri,': 0.28; 'message- id:@mail.gmail.com': 0.28; 'explicitly': 0.29; "it'd": 0.30; "i'll": 0.33; 'to:addr:python-list': 0.34; 'none': 0.35; 'probably': 0.35; 'subject:new': 0.36; 'useful': 0.37; 'but': 0.37; 'received:google.com': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.38; 'returning': 0.38; 'to:addr:python.org': 0.39; 'received:209': 0.40
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=e2woBqi+6XuGiriY0SWAWMLE0GiTyB/cH9DJ/Yskioo=; b=sl2POrh6mTcx/f6tqWC8tjTQcEHOqFe4wS80/0X443QCnMwD8YybhVAMWjrbnV81C1 9Tgbl96OusH8rwha0i8XPaHUrSN1k8He3PIZsayuL1msjbD4CyvnQ9oowFiKf5WGxzn6 zdVFtWcrWVqrj80g+tqJMhf8sx65CPBhs2wn0=
MIME-Version 1.0
In-Reply-To <4E31CE8F.4080606@stoneleaf.us>
References <4E3182C3.9040306@stoneleaf.us> <CALwzidmRwWqS-nY3==8XetBMe2cS7DRikZ6OWOwbQ61w99X9tg@mail.gmail.com> <4E31CE8F.4080606@stoneleaf.us>
Date Fri, 29 Jul 2011 07:16:46 +1000
Subject Re: NoneType and new instances
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
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.1594.1311887809.1164.python-list@python.org> (permalink)
Lines 14
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1311887809 news.xs4all.nl 23897 [2001:888:2000:d::a6]:57567
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:10482

Show key headers only | View raw


On Fri, Jul 29, 2011 at 7:03 AM, Ethan Furman <ethan@stoneleaf.us> wrote:
> I'll use a lambda to get around it, but that's not very elegant.  Why
> shouldn't NoneType be able to return the singleton None?

Why a lambda?

def ThisFunctionWillReturnNone():
    pass

Although, since the returning of None is crucial to it, it'd probably
be better to explicitly "return None". But minimalist useful functions
are amusing.

ChrisA

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


Thread

Re: NoneType and new instances Chris Angelico <rosuav@gmail.com> - 2011-07-29 07:16 +1000
  Re: NoneType and new instances Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-29 11:29 +1000

csiph-web