mutable default parameter problem [Prothon]

Mark Hahn mark at prothon.org
Wed Jun 16 05:00:07 EDT 2004


Troy Melhase wrote:

> You're right, it's not a newbie problem.  It's a problem for everyone
> who hasn't bothered to read the documentation.

Having a language with features intuitive enough to require less trips to
the documention is a laudable goal.  Of course you know what I really meant
was what I said in the original posting.  Even experts have to write extra
code to get around this problem  The following is a common piece of Python
code that is a problem work-around:

    def f( a = None ):
            if a == None: a = []

> Uncool?  Do you mean "uncool" as in "forking a language and
> distracting a bunch of folks ...

Evolution works by forking.  If you have some problem with Prothon then
let's discuss it.  Don't hide your problem with Prothon behind your
discussion of this thread's topic.

> (And by the way, one definition of love means to accept what we
> perceive as deficiencies.  So maybe you don't love Python as dearly
> as you love the idea of Python.)

You can love something and still want to improve it.  Don't tell my wife I
said this :-)

>> That count is not accurate.  Fixing this will not break every use of
>> [] as a default formal param.  <correction removed>.   I can think of
many
>> other cases where it is legal to use [].  The only case I can think of
that would
>> break would be the idiom we disagree on above.  If I am wrong, then show
>> me other cases.
>
> Oh, but it will.  You'll have to read and comprehend every function
> definition that uses mutable default arguments to start to prove
> otherwise.

I'm not sure I follow you.  I'm saying that you only have to show me one or
two cases for me to realize I'm wrong.

> Maybe you should take a step back and look at what you're doing.
> From my perspective, you're adding a whole lot of additional rules to
> the language, and a completely different way of doing things.  That's
> fine, and more power to you, but if you're bent on changing so much,
> you should stop looking to c.l.p to validate your ideas.

I'm not looking for validation, just a reasonable discussion of the issue of
which of the three methods to use to fix the problem.  You are the one that
started the seperate discussion as to whether it should be fixed or not.

By the way, Prothon is removing a lot of rules, not adding them, by it's
simplification in almost all areas.

> (Of course, I don't speak for the Python community or c.l.p, but I am
> horrified nonetheless with what you're doing.  Please forgive me if
> I've been disagreeable while disagreeing.)

No problem.  I am quite thick-skinned.  I also apologize if I have been
harsh.

I am sorry you are so upset that someone is daring to make a changed Python.
I expected this reaction from many Python afficionados who may love the
warts as much as the beauty.  I was surprised that Prothon was received as
warmly as it was here at c.l.p.  All you have to do is ignore any postings
with subjects that end in [Prothon].









More information about the Python-list mailing list