what does 'a=b=c=[]' do

rusi rustompmody at gmail.com
Fri Dec 23 05:22:33 EST 2011


On Dec 23, 2:39 pm, Steven D'Aprano <steve
+comp.lang.pyt... at pearwood.info> wrote:
> On Fri, 23 Dec 2011 00:38:07 -0800, rusi wrote:
> > Likewise function arguments that default to mutable entities is a known
> > gotcha of python which is best treated as a bug in python.
>
> Nonsense. It is a feature, not a bug.

Tsk Tsk How can python have a bug? And that too on the python mailing
list?

Others however feel differently. See Chris Rebert's
http://mail.python.org/pipermail/python-ideas/2007-January/000073.html
and the links cited there.

>
> Some people might argue that it is a mistake, a minor feature which
> allegedly causes more difficulties than benefits. I do not hold with that
> idea. But either way, it is not a bug to be fixed, but a deliberate
> consequence of intended semantics.

I did not ask or imply that it should be 'fixed', just that language
misfeatures should be treated with extra care.
Windows uses CRLF where Unix uses LF.  Nobody could argue that this
discrepancy is of any use and nobody is about to fix it.

Of course if "bug" means "must-fix-else-unusable" then sure you are
right but then we would not be able to use most of the hardware or
software that we do.

To restate what (I think) Ian is saying:

Exploit language misfeatures cleverly in your code if you want. But
please red-flag them in mailing list posts.



More information about the Python-list mailing list