Square Rutabaga
They said never be content. So I'm micro-contenting.



Subscribe to "Square Rutabaga" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.
 

 

Tuesday, August 12, 2003
 
Searching for the obvious

Ever try to figure out the proper way to do something complicated only to find it has been front-loaded to a dead-simple implementation/solution?

Python and Google surprised me with a. Adding an item to a dictionary, and b. Line continuations/explicit line joining.

a. Where is the dict.add( key, value ) ? It's dict[key]=value.   Ahhh...  Ever search for specification terms that don't exist?

b. How do I allow a single line/expression of python to span multiple lines?  "\" at the end, ahh..  Note to self: Figure out spacing nuances.  Google was no help as I was bent on "line continuation" which returned me 101 ways to make a string or regex span multiple lines. How do I know it should have been obvious?  It's chapter 2, but the search hits continuously returned mirrors of Chapter 7.

(Note: The preceding is very crude recollection of a instance where I wound up ActivePython for an "let's figure out this algorithm with Python" session, and I once again found myself hastily trying to find the obvious.  I wanted this to be a polished micro-article entry "code in under 60 columns" which would have some nice stats regarding search terms, concepts whiched swarmed search-hits, and a request for Pythoneering bloggers to publish related 20 second readable entries covering secondary basics when encountering similar situations.  But who wants to admit they got hung up on terminology or forgot a fundamental and overlooked the obvious? Those willing to help others avoid it also.  Sometimes these others will just be folks at the end of the day looking to use that nifty other snake language that's supposedly intuitive and coding quicker, hence a tendency for disappointment when online searching[1] requires digging[2]. [1] Not coding, [2] brainstorming for terms..scanning mailing lists and different context details.)

To conclude I would not recommend the Python Reference Manual to a general user. Start with the Intros, or these references


12:30:53 AM    , comment []


Previous/Next
Click here to visit the Radio UserLand website. © Copyright 2003 Dean Goodmanson.
Last update: 9/4/2003; 11:03:53 PM.
This theme is based on the SoundWaves (blue) Manila theme.
August 2003
Sun Mon Tue Wed Thu Fri Sat
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Jul   Sep