Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:Python': 0.05; 'compiler': 0.05; 'from:addr:yahoo.co.uk': 0.05; 'oh,': 0.09; 'pointers': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'stack': 0.13; 'wed,': 0.15; 'cares': 0.16; 'happily': 0.16; 'input.': 0.16; 'nearest': 0.16; 'parameters,': 0.16; 'partly': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'sense,': 0.16; 'sits': 0.16; 'structs': 0.16; 'wrote:': 0.16; 'memory': 0.17; 'language': 0.19; '>>>': 0.20; 'saying': 0.22; 'lawrence': 0.22; 'pre': 0.22; 'struct': 0.22; 'pass': 0.22; 'bit': 0.23; '2015': 0.23; 'forgot': 0.23; 'passing': 0.23; "python's": 0.23; 'header:In-Reply-To:1': 0.24; 'header:User- Agent:1': 0.26; 'idea': 0.26; 'header:X-Complaints-To:1': 0.26; 'chris': 0.26; 'ago': 0.27; 'equivalent': 0.27; 'closer': 0.29; 'function': 0.30; 'that.': 0.30; 'language.': 0.32; 'possibly': 0.32; 'values.': 0.33; 'subject:?': 0.34; 'to:addr:python-list': 0.35; 'c++': 0.35; 'really': 0.35; 'but': 0.36; "didn't": 0.37; 'subject:: ': 0.37; 'thought': 0.37; 'rather': 0.38; 'received:org': 0.38; 'pm,': 0.39; 'does': 0.39; 'to:addr:python.org': 0.39; 'mark': 0.40; 'forget': 0.60; 'back': 0.61; 'thomas': 0.63; 'our': 0.64; 'charset:windows-1252': 0.65; 'computers': 0.70; 'angelico:': 0.84; 'chrisa': 0.84; 'pythonistas,': 0.84; 'rachel': 0.84; 'burn': 0.91; 'received:2': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: Can Python function return multiple data? Date: Wed, 03 Jun 2015 22:56:28 +0100 References: <3bbe49da-e989-4a8c-a8a9-75d3a786f508@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-2-98-194-38.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 In-Reply-To: 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: 36 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1433368610 news.xs4all.nl 2886 [2001:888:2000:d::a6]:39483 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:92004 On 03/06/2015 22:35, Chris Angelico wrote: > 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 > Don't forget that C functions can accept structs as input. Possibly not a good idea as I found out many years ago pre ANSIC when I forgot that little old ampersand, so the compiler didn't pick it up, but then with modern computers having so much memory who really cares if you burn a little bit of stack on structures rather than pointers to structures? Now does Python pass by value or by reference? Happily sits back and waits for 10**6 emails to arrive as this is discussed for the 10**6th time. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence