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


Groups > comp.lang.python > #35650

RE: Function Parameters

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <jcasale@activenetwerx.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.008
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'arguments': 0.07; 'caller': 0.07; 'suppose': 0.07; 'arg': 0.09; 'kwargs': 0.09; 'similar,': 0.09; 'spec': 0.09; 'subject:Function': 0.09; 'defaults.': 0.16; 'inputs': 0.16; 'thanks,': 0.18; 'assignment': 0.22; 'dependent': 0.23; 'header:In-Reply-To:1': 0.25; '(which': 0.26; 'used,': 0.27; 'received:10.0.0': 0.28; 'optional': 0.29; 'this.': 0.29; 'keyword': 0.30; 'function': 0.30; 'sense': 0.31; 'could': 0.32; 'received:10.0': 0.33; 'to:addr:python-list': 0.33; 'list': 0.35; 'but': 0.36; 'possible': 0.37; 'two': 0.37; 'ones': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'received:10': 0.38; 'to:addr:python.org': 0.39; 'called': 0.39; 'charset:windows-1256': 0.61; 'received:unknown': 0.63; 'here': 0.65; 'vain': 0.84; 'valid)': 0.84
X-Cloudmark-SP-Filtered true
X-Cloudmark-SP-Result v=1.1 cv=HUoWN8sqH4wajA0WKpKyUV7G7o/UpN4YSPso/+twBIs= c=1 sm=1 a=QxjuIguZGUkA:10 a=7PYXob_7ZXMA:10 a=BLceEmwcHowA:10 a=eoNxP8pz9j0A:10 a=oNw28mxuUhXRB3mVwYQ4Ag==:17 a=0XfHP5V0WImh09o0cfIA:9 a=RFXaeJp-pwgA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117
From "Joseph L. Casale" <jcasale@activenetwerx.com>
To Python ‎[python-list@python.org]‎ <python-list@python.org>
Subject RE: Function Parameters
Thread-Topic Function Parameters
Thread-Index Ac3kbJsJxMd6LrIuQ2+aYGpZlCzOMQAP4jGA//+NWnA=
Date Thu, 27 Dec 2012 20:47:54 +0000
References <CALwzidmKXuHmGWMAoJbeiCxmPpmqd1tvAVxDuZZTAzL0TbgC_A@mail.gmail.com>
In-Reply-To <CALwzidmKXuHmGWMAoJbeiCxmPpmqd1tvAVxDuZZTAzL0TbgC_A@mail.gmail.com>
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 <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.1366.1356641342.29569.python-list@python.org> (permalink)
Lines 20
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1356641342 news.xs4all.nl 6980 [2001:888:2000:d::a6]:44921
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:35650

Show key headers only | View raw


> Don't use kwargs for this.  List out the arguments in the function
> spec and give the optional ones reasonable defaults.

> I only use kwargs myself when the set of possible arguments is dynamic
> or unknown.

Gotch ya, but when the inputs to some keywords are similar, if the function is called
with two of three (which is valid) and the arg name isn't used, the assignment is order
dependent and arbitrary in a sense and I can not distinguish.

It would be nice if you could force the keyword to be mandatory to forgo the assumption
in assignment like kwargs provides with gets. I suppose all the time wasted here is in vain
as the caller could blunder elsewhere...

Thanks,
jlc

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


Thread

RE: Function Parameters "Joseph L. Casale" <jcasale@activenetwerx.com> - 2012-12-27 20:47 +0000

csiph-web