This post originated from an RSS feed registered with Python Buzz
by Dean Goodmanson.
Original Post: Searching for the obvious
Feed Title: Dean Goodmanson: Slices of Py
Feed URL: http://www.pycs.net/sqr/categories/slicesOfPy/rss.xml
Feed Description: Bits from the world of the Python programming language.
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.)