[Tutor] telling dir(_builtins_) from dir(__builtins__)

Lloyd Kvam pythontutor@venix.com
Thu, 14 Mar 2002 17:42:47 -0500


One thing that gets me sometimes in the documentation is that square
brackets are used for optional pieces of syntax.  Square brackets are
also used to delimit lists.  So documentation about lists (e.g. List
Comprehension syntax) can be confusing.

john public wrote:

> How in the heck is a Newwbie to know  dir(_builtins_) from 
> dir(__builtins__)?!? both look like one hypen to me. One's just longer 
> than the other. I just assumed it was a difference between the type on 
> my machine and the type in the O'riely book. I have been working in Alan 
> Gaulds book and looking a bit in Learning Python and programming Python 
> and don't recall reading about this distinction. I am sure glad I can 
> ask you guys questions. This is exactly the kind of tedious dotting 
> your I's and crossing your T's that drove me nuts years ago when I tried 
> to learn basic but gave up. So far this is the first thing I have found 
> like this in Python. I have actually been amazed at how easy it is 
> compared to C++ which I worked at for 2 months and got relatively 
> nowhere by comparison. I am sure glad Barry Warsaw steered me towards 
> Python.
> 
>  THANKS BARRRRRY!!
> 
>  I can't remember how I found Barry's Web page but I am sure glad I did. 
> Anyway if someone has a list of visually misleading things like this in 
> Python please send me the link.
> 
> Thankzzz
> 
> 
> ------------------------------------------------------------------------
> Do You Yahoo!?
> Yahoo! Sports <$rd_url/tag/http://sports.yahoo.com/> - live college 
> hoops coverage


-- 
Lloyd Kvam
Venix Corp.
1 Court Street, Suite 378
Lebanon, NH 03766-1358

voice: 
603-443-6155
fax: 
801-459-9582