Default Value

rusi rustompmody at gmail.com
Thu Jun 20 09:31:16 EDT 2013


On Jun 20, 6:19 pm, Roy Smith <r... at panix.com> wrote:
> In article
> <447dd1c6-1bb2-4276-a109-78d7a067b... at d8g2000pbe.googlegroups.com>,
>
>  rusi <rustompm... at gmail.com> wrote:
> > > > def f(a, L=[]):
> > > >     L.append(a)
> > > >     return L
> > Every language has gotchas. This is one of python's.
>
> One of our pre-interview screening questions for Python programmers at
> Songza is about this.  I haven't been keeping careful statistics, but
> I'd guess only about 50% of the candidates get this right.

See http://www.cs.utexas.edu/~EWD/transcriptions/EWD04xx/EWD480.html
(search forward to 'disastrous blending' )
No I am not saying that such knowledge is not required in the 'real
world'

However I do feel that just as a view of literature that does not go
beyond gothic horror is a poor view;
and just because for languages like C (even more C++) expertise more
or less equivales gothicness,
for a cleaner world like python we should distinguish the seedy areas
we know about but avoid and the clean areas we live in.
Clearly flagging gotchas as such helps in that direction.

In short (and to the OP): If you did NOT find this confusing, it would
be cause for more concern :-)



More information about the Python-list mailing list