Default Value

Chris Angelico rosuav at gmail.com
Fri Jun 21 21:41:46 EDT 2013


On Sat, Jun 22, 2013 at 11:27 AM, Ian Kelly <ian.g.kelly at gmail.com> wrote:
> On Fri, Jun 21, 2013 at 7:15 PM, Steven D'Aprano
> <steve+comp.lang.python at pearwood.info> wrote:
>> On Fri, 21 Jun 2013 23:49:51 +0100, MRAB wrote:
>>
>>> On 21/06/2013 21:44, Rick Johnson wrote:
>> [...]
>>>> Which in Python would be the "MutableArgumentWarning".
>>>>
>>>> *school-bell*
>>>>
>>> I notice that you've omitted any mention of how you'd know that the
>>> argument was mutable.
>>
>> That's easy. Just call ismutable(arg). The implementation of ismutable is
>> just an implementation detail, somebody else can work that out. A
>> language designer of the sheer genius of Rick can hardly be expected to
>> worry himself about such trivial details.
>
> While we're at it, I would like to petition for a function
> terminates(f, args) that I can use to determine whether a function
> will terminate before I actually call it.

Nice idea from a theoretical point of view, but practicality beats
purity, and most people know their functions will terminate (that's
what Ctrl-C is for). No, I want a function isbuggy(f) to find out
whether a function is, well, buggy. We could abolish all unit-testing
if we had that.

ChrisA



More information about the Python-list mailing list