Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!weretis.net!feeder4.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!bcyclone05.am1.xlned.com!bcyclone05.am1.xlned.com!lightspeed.eweka.nl!lightspeed.eweka.nl!newsfeed.xs4all.nl!newsfeed1a.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.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:Python': 0.05; 'oh,': 0.09; 'pointers': 0.09; 'cc:addr:python-list': 0.10; 'wed,': 0.15; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'nearest': 0.16; 'parameters,': 0.16; 'partly': 0.16; 'sense,': 0.16; 'wrote:': 0.16; 'cc:2**0': 0.21; 'cc:addr:python.org': 0.21; 'saying': 0.22; 'struct': 0.22; '2015': 0.23; 'forgot': 0.23; 'passing': 0.23; "python's": 0.23; 'header:In-Reply-To:1': 0.24; 'chris': 0.26; 'equivalent': 0.27; 'message-id:@mail.gmail.com': 0.28; 'closer': 0.29; 'function': 0.30; 'that.': 0.30; 'language.': 0.32; 'values.': 0.33; 'subject:?': 0.34; 'received:google.com': 0.34; 'c++': 0.35; 'but': 0.36; 'subject:: ': 0.37; 'thought': 0.37; 'pm,': 0.39; 'thomas': 0.63; 'angelico:': 0.84; 'chrisa': 0.84; 'rachel': 0.84; 'to:none': 0.90 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=CnhS7jyxbAgQ8EW1OPgtaTuT+mW5pnRa7DjPCmtGPhU=; b=BUrXnfAGwZw7lglHjQ32ChfMYp2x6znG9sYMwseT0u7OWMER3pSsANP2r3PJL4jCxe unko9q2ksIwdmPXmW0V+ij3iXgicOxm/YcZgqfLy+zyz5Hw2dnbugBrIcfWDyPXzvSbP dLom656i7xVpeyV1WbM7W2a9X5qnQZzA4kDGklQxuwhpt52lh95RJD29ceXpcE21lRJe F8+Vt1Y78axO6rKRluaRRZePM5Qsq8a2r/sOXGU43ewwKB3Dmtbu7adLH6ogF91jKdkH s7j+bP/XOYNcni/BERdC4jkH1Oz4MoshbvtgTCHTYLsD86cPvdRJ1zMjJns4sQngZUJ6 DY+A== MIME-Version: 1.0 X-Received: by 10.50.61.241 with SMTP id t17mr1022342igr.34.1433367328323; Wed, 03 Jun 2015 14:35:28 -0700 (PDT) In-Reply-To: References: <3bbe49da-e989-4a8c-a8a9-75d3a786f508@googlegroups.com> Date: Thu, 4 Jun 2015 07:35:28 +1000 Subject: Re: Can Python function return multiple data? From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1433367337 news.xs4all.nl 2887 [2001:888:2000:d::a6]:51932 X-Complaints-To: abuse@xs4all.nl X-Received-Body-CRC: 2251161555 X-Received-Bytes: 3851 Xref: csiph.com comp.lang.python:92000 On Wed, Jun 3, 2015 at 11:56 PM, Thomas Rachel wrote: > Am 03.06.2015 um 01:56 schrieb Chris Angelico: > >> and it's pretty convenient. In C, the nearest equivalent is passing a >> number of pointers as parameters, and having the function fill out >> values. Python's model is a lot closer to what you're saying than C's >> model is :) > > > At least, C functions can return structs... Oh, yes, I forgot about that. Thought that was C++ but not C, partly because I never do it in either language. Although in a sense, a struct is still a single "thing". ChrisA