default value in __init__

Daniel da Silva ddasilva at umd.edu
Tue Oct 14 23:23:12 EDT 2008


I would just like to add to the discussion that 4as a second year computer
science undergraduate and I noticed the same "issue" with default arguments,
but I was able to figure out the system of how (and why) python does it the
way it does, without having to consult any documentation offline or online.
If the person notices that arg={} is yielding an unexpecting result, the
next step I would guess they would PROBABLY try setting arg=None and insert
"if arg==None: arg={}" at the head of their method. It doesn't take a
tremendous amount of cleverness power to try an alternate method that is
logically equivalent to the intention.


Daniel

On Tue, Oct 14, 2008 at 10:25 PM, Dennis Lee Bieber
<wlfraed at ix.netcom.com>wrote:

> On Tue, 14 Oct 2008 20:50:13 +0200, Bruno Desthuilliers
> <bdesth.quelquechose at free.quelquepart.fr> declaimed the following in
> comp.lang.python:
>
> >
> > As far as I'm concerned, I started with the FineManual(tm)'s tutorial.
> >
>         Heh... whereas my introduction was the original O'Reilly Python
> text
> book, with a copy of the Amiga Python on disk... By the end of the week,
> I'd mashed together a rudimentary mail send utility in Python using
> ARexx for the client to spool queuing (needed as, at that time, Amiga
> email clients were very raw -- they required stand-alone external POP3
> and SMTP programs to work with spool directories... And the first
> program I used for SMTP created a message per destination address and
> would block the entire outgoing spool if it couldn't connect to any
> particular address... The second program I tried did relay via ISP
> server -- but failed to transfer CC and BCC destinations!)
>
> > I'm afraid I have to say this is *totally* utopic - except perhaps for
> > the most braindead and limited language one could imagine. Heck, even
> > Java - which has explicitely been designed for morons^Mdummies - would
> > fail this test. How could "a few examples" provide complete
> > understanding of attribute lookup rules, the descriptor protocol,
> > metaclasses, iterators, and generator expression - just to name a few ?
> >
>         As far as I'm concerned, Java fails it even for experienced
> programmers... There is just too much overhead in just doing "hello
> world" that one NEEDS something like Eclipse just to start coding.
>
>        If one wants to avoid reading documentation, my suggestion would be
> to install a version of old K&K BASIC, circa 1970.
> --
>        Wulfraed        Dennis Lee Bieber               KD6MOG
>        wlfraed at ix.netcom.com           wulfraed at bestiaria.com
>                HTTP://wlfraed.home.netcom.com/
>        (Bestiaria Support Staff:               web-asst at bestiaria.com)
>                HTTP://www.bestiaria.com/
> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
Daniel da Silva
(240) 678 - 4686
GSFC, GES-DISC 610.2
University of Maryland
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20081014/38eaa38d/attachment-0001.html>


More information about the Python-list mailing list