Google

   
www gsu.edu

Miscellaneous

"Life is not measured by the number of breaths you take, but by every moment that takes your breath away."

 

 

Here is an example of joining a list from the buildConnectionString function:
     return ";".join(["%s=%s" % (k, v) for k, v in params.items()])
One interesting note before you continue. I keep repeating that functions are objects, strings are objects... everything is an object. You might have thought I meant that string variables are objects. But no, look closely at this example and you'll see that the string ";" itself is an object, and you are calling its join method.

 

 

As you know, everything in Python is an object, and introspection is code looking at other modules and functions in memory as objects, getting information about them, and manipulating them. Along the way, you'll define functions with no name, call functions with arguments out of order, and reference functions whose names you don't even know ahead of time.

 

 

As you know, Python has powerful capabilities for mapping lists into other lists, via list comprehensions (Section 3.6, Mapping Lists). This can be combined with a filtering mechanism, where some elements in the list are mapped while others are skipped entirely.
Here is the list filtering syntax:
     [mapping-expression for element in source-list if filter-expression]
This is an extension of the list comprehensions that you know and love. The first two thirds are the same; the last part, starting with the if, is the filter expression. A filter expression can be any expression that evaluates true or false (which in Python can be almost anything). Any element for which the filter expression evaluates true will be included in the mapping. All other elements are ignored, so they are never put through the mapping expression and are not included in the output list.

 

 

.... Luckily, Python comes with a module to do exactly this, and it's called copy. I won't go into the details here (though it's a wicked cool module, if you're ever inclined to dive into it on your own). Suffice it to say that copy can copy arbitrary Python objects, and that's how you're using it here.

 

 

To all who want Tibet "Free"!!

See The Ugly Face of "Free Tibet" Member attacked Olympic torch bearer, who is a disabled girl in wheelchair.
Where is the Dalai Lama now?
Where is the Dalai Lama now??
Where is the Dalai Lama now???
Where is the Dalai Lama now????
Is this what you want?
Bring more hates between Chinese and Chinese???
What a shame!