Dictionaries are one of the built in types that I really like in Python. (I think of them as the equivalent of dt and dd in HTML, if that helps anyone.)
But I made a typo, and that typo works. Now the typo is playing with my head. Take a look as this history from the Python Interpreter:>>> d={}
>>> d['key']=d
>>> d
{'key': {...}}
Yes, if this is correct, Python knows that dictionary ‘d’ has a key named ‘key’ that contains dictionary ‘d’.
What makes this example particularly cool is the {...}, which shows Python knows that there is no bottom at the end of this dictionary.
This is so cool.
These examples work too:
>>> d['key']['key']
{'key': {...}}
>>> d['key']['key']['key']['key']['key']['key']
{'key': {...}}
Sep 02, 2005, 07:41PM PDT | 1 cheer | 0 comments
The courier arrived with The Book while I was at work, but thankfully the Property Management company for my condominium signed for it.
And so here I sit, at home on a Tuesday evening, with my very own copy of The Pragmatic Programmer.
After reading some reviews on the web, I was worried that the typesetting would be poor, but all the grousing is unwarranted.
The copy I have is professionally printed and well laid out with a good mix of white space and text.
Since I am starting out on a new project, I think that I will read Chapter 7 on specifications first.
Aug 30, 2005, 06:02PM PDT | 2 cheers | 1 comment
It took the afternoon, but I found the useful Python module that creates a web server so that you can browse installed modules from your web browser:
It’s called pydoc.
Aug 27, 2005, 04:59PM PDT | 0 comments