Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #2955
| From | "Colin J. Williams" <cjw@ncf.ca> |
|---|---|
| Subject | Re: Argument of the bool function |
| Date | 2011-04-10 13:51 -0400 |
| References | <4d9f374b$0$12803$426a34cc@news.free.fr> <mailman.154.1302280920.9059.python-list@python.org> <4da1a8b5$0$23679$426a74cc@news.free.fr> <mailman.190.1302440567.9059.python-list@python.org> <inslea$p6d$1@speranza.aioe.org> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.196.1302457887.9059.python-list@python.org> (permalink) |
On 10-Apr-11 12:21 PM, Mel wrote:
> Chris Angelico wrote:
>
>> Who would use keyword arguments with a function that takes only one arg
>> anyway?
>
> It's hard to imagine. Maybe somebody trying to generalize function calls
> (trying to interpret some other language using a python program?)
>
> # e.g. input winds up having the effect of ..
> function = bool
> name = 'x'
> value = 'the well at the end of the world'
> ## ...
> actions.append ((function, {name:value}))
> ## ...
> for function, args in actions:
> results.append (function (**args))
>
> Not something I, for one, do every day. But regularity in a language is
> good when you can get it, especially for abstract things like that.
>
> I can sort of guess that `dir` was perhaps coded in C for speed and doesn't
> spend time looking for complicated argument lists.
>
> Python is a pragmatic language, so all the rules come pre-broken.
>
>
> Mel.
This thread has lasted 3 days so far.
I presume that it is agreed they the following is a satisfactory outcome:
*** Python 2.7.1 (r271:86832, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit
(Intel)] on win32. ***
>>> bool(x=0)
False
>>> bool(x=1)
True
>>>
Colin W.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar
Argument of the bool function candide <candide@free.invalid> - 2011-04-08 18:26 +0200
Re: Argument of the bool function Benjamin Kaplan <benjamin.kaplan@case.edu> - 2011-04-08 12:41 -0400
Re: Argument of the bool function candide <candide@free.invalid> - 2011-04-10 14:54 +0200
Re: Argument of the bool function Chris Angelico <rosuav@gmail.com> - 2011-04-10 23:02 +1000
Re: Argument of the bool function Mel <mwilson@the-wire.com> - 2011-04-10 12:21 -0400
Re: Argument of the bool function "Colin J. Williams" <cjw@ncf.ca> - 2011-04-10 13:51 -0400
Re: Argument of the bool function Ben Finney <ben+python@benfinney.id.au> - 2011-04-11 09:46 +1000
Re: Argument of the bool function Ethan Furman <ethan@stoneleaf.us> - 2011-04-11 16:00 -0700
Re: Argument of the bool function Mel <mwilson@the-wire.com> - 2011-04-08 16:42 +0000
Re: Argument of the bool function Ian Kelly <ian.g.kelly@gmail.com> - 2011-04-08 10:43 -0600
Re: Argument of the bool function candide <candide@free.invalid> - 2011-04-08 23:32 +0200
Re: Argument of the bool function Ethan Furman <ethan@stoneleaf.us> - 2011-04-08 15:03 -0700
Re: Argument of the bool function candide <candide@free.invalid> - 2011-04-09 00:59 +0200
Re: Argument of the bool function Lie Ryan <lie.1296@gmail.com> - 2011-04-09 15:45 +1000
Re: Argument of the bool function Grant Edwards <invalid@invalid.invalid> - 2011-04-10 03:35 +0000
Re: Argument of the bool function rusi <rustompmody@gmail.com> - 2011-04-09 21:15 -0700
Re: Argument of the bool function Robert Kern <robert.kern@gmail.com> - 2011-04-10 01:22 -0500
Re: Argument of the bool function Robert Kern <robert.kern@gmail.com> - 2011-04-09 18:22 -0500
Re: Argument of the bool function candide <candide@free.invalid> - 2011-04-10 02:33 +0200
Re: Argument of the bool function Ben Finney <ben+python@benfinney.id.au> - 2011-04-09 07:57 +1000
csiph-web