Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Newsgroups: comp.lang.python Subject: Question on keyword arguments Date: Thu, 18 Feb 2016 09:00:10 -0500 Lines: 23 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: news.uni-berlin.de YFxaxuDfPg/TLz2Tzxv5aQW/34+vOrEM+ocv2nNF/ZJQ== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'else:': 0.03; '"""': 0.05; 'subject:Question': 0.05; '__name__': 0.07; 'preferable': 0.09; 'python': 0.10; 'def': 0.13; 'result.': 0.15; "'__main__':": 0.16; 'programmer)': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'thanks,': 0.24; 'correct': 0.28; 'to:name:python-list': 0.30; 'received:10.0': 0.34; 'list': 0.34; 'to:addr:python-list': 0.36; 'received:10': 0.37; 'to:addr:python.org': 0.40; 'from:no real name:2**0': 0.60; 'default': 0.61; 'received:38': 0.81; 'received:38.111': 0.84 X-Scanner-Info: Cloudmark - http://www.cloudmark.com X-CNFS-Analysis: v=2.1 cv=eq4itddX c=1 sm=1 tr=0 a=wmZXJE1MrsZYcnKSeUNejA==:117 a=wmZXJE1MrsZYcnKSeUNejA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=r77TgQKjGQsHNAKrUKIA:9 a=pwq2097MI4YzyTye-zcA:9 a=wPNLvfGTeEIA:10 a=G0k64VlqXco3sfAqzk4A:9 a=lTLXaqXgNAEAIREd:21 a=_W_S_7VecoQA:10 X-CMAE-Score: 0.00 X-Scanned-by: CMAE X-AUTH-ID: grsmith@atlanticbb.net X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 15.4.3555.308 X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3555.308 X-CMAE-Envelope: MS4wfNqWBoaa8YSFRGOHLW6SZfSAeLcsl0W0AkMepsCGi80BbzhAu9gYm3LYNOGOSV5lGz2z9mylBC2wMvttHomU4D4r11SUqxdy1DwQZblMFZw1HsiDmXU2isCIbNY81RBS/nM6/+aTsvzg9nq/FqQN1Khzg8bq2ht4yCwwa3hfwQ67wCwk9pQhH/J4jMt0HrrDP+z4JU9URPHEOStcWu+8w04= X-Mailman-Approved-At: Thu, 18 Feb 2016 09:11:45 -0500 X-Content-Filtered-By: Mailman/MimeDel 2.1.21rc2 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21rc2 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:103115 Would this be the correct way to return a list as a default result. Also, would the list be the preferable result (to a python programmer) ? def test(command, return_type=3D'LIST'): """ Go to database and return data""" if return_type =3D=3D 'LIST': result =3D ['ONE', 'TWO', 'THREE'] else: result =3D r'0xfeONE\0exfeTWO\0xfeTHREE' return result if __name__ =3D=3D '__main__': print(test('cmd')) print(test('cmd', 'LIST')) print(test('cmd', None)) print(test('cmd', 'string')) thanks, george