Things I learned about Python

From Mark Ramm’s in person class. Only 11 people, including myself, so I didn’t feel like I was squatting. Well, at least not too much.

My knowledge from Python 1.4 days is pretty much useless.

Mostly in comparison to other languages.

Lists in perl vs. python:
Python Perl
l.expand(element) push @l, $element
l.pop() pop @l
l.insert(0,element) unshift @l, $element
l.pop(0) shift @l

help() is every bit as capable as perldoc

List comprehensions are just a big name for some iterator syntax sugar. (sorry python guys, that is my take).

Introspection in python is WAY easier than Reflection in .NET.

help(modules), help(), import __builtin__;help(__builtin__), are great starting points for help in python.

True, False, and Null have some interesting properties. 0, [], (), “” (zero, empty list, empty tuble, empty string) are all considered false. Yet comparison with True or False still yeilds false. I think the logic is similar to NULL in SQL, but I have not found definitive Python docs stating such.

Python uses different terms to describe things. Member variables are called attributes. C, C++ and C# have attributes but they are entirely different things.

There are no member access modifiers in python (no private, public, protected and internal).

This TurboGears course is definitely beyond me. The fact that I’m having trouble installing it on my laptop is a bummer. I’m thinking setuptools and windows don’t like each other that much. TurboGears subversion may work better, I don’t know. (5 min later… I do know. I hate that IBM ships python and it is in my default path on this T42… Major Oops!)

TurboBlog is a turbogears open source blog software which may be good to examine when learning turbogears.