Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!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.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'args': 0.04; 'arguments': 0.07; 'function,': 0.07; 'strings.': 0.07; '**kwargs):': 0.09; 'incorrect': 0.09; 'subject:Function': 0.09; 'def': 0.10; 'cases': 0.15; 'assignment': 0.22; 'doc': 0.22; 'raise': 0.24; 'thanks!': 0.26; 'received:24': 0.27; 'this?': 0.28; 'received:10.0.0': 0.28; 'optional': 0.29; 'like:': 0.33; 'handle': 0.33; 'received:10.0': 0.33; 'to:addr:python-list': 0.33; 'skip:k 20': 0.35; 'something': 0.35; 'test': 0.36; 'some': 0.38; 'received:10': 0.38; 'to:addr:python.org': 0.39; 'charset:windows-1256': 0.61; 'provide': 0.62; 'received:unknown': 0.63; 'loose': 0.84 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=qT60hWcJq2tKMlwzTlfV91MSQCJjCwg5oP07qu3o0oU= c=1 sm=1 a=QxjuIguZGUkA:10 a=7PYXob_7ZXMA:10 a=BLceEmwcHowA:10 a=eoNxP8pz9j0A:10 a=oNw28mxuUhXRB3mVwYQ4Ag==:17 a=NhrkS94UxR_LJiJGFuIA:9 a=RFXaeJp-pwgA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 From: "Joseph L. Casale" To: =?windows-1256?Q?Python_=FD=5Bpython-list=40python=2Eorg=5D=FD?= Subject: Function Parameters Thread-Topic: Function Parameters Thread-Index: Ac3kbJsJxMd6LrIuQ2+aYGpZlCzOMQ== Date: Thu, 27 Dec 2012 20:16:13 +0000 Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.0.0.200] Content-Type: text/plain; charset="windows-1256" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1356639440 news.xs4all.nl 6882 [2001:888:2000:d::a6]:50778 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:35646 When you use optional named arguments in a function, how do you deal with w= ith=0A= the incorrect assignment when only some args are supplied?=0A= =0A= If I do something like:=0A= =0A= def my_func(self, **kwargs):=0A= =0A= then handle the test cases with:=0A= =0A= if not kwargs.get('some_key'):=0A= raise SyntaxError=0A= or:=0A= =0A= if kwargs.get('some_key') and kwargs.get('another_key'):=0A= ...=0A= =0A= I loose the introspection that some IDE's provide from the doc strings.=0A= =0A= Any ideas on how to deal with this?=0A= =0A= Thanks!=0A= jlc=