Learn core Python from Stackoverflow

The other day I needed to brush up my knowledge on Python decorators, for implementing a profiling hook for a Django REST API I’ve been working on. I googled around and landed on a question titled Understanding Python Decorators on Stackoverflow.com. The answer given by the user e-satis is an excellent introduction to decorators in Python, although it has not been selected as the official answer. Go ahead an give it read if you have done some Python coding.

This got me thinking. This guy does not care about whether or not his answer gets selected before others (so that he can bag some reputation). He took his time and explained what decorators are in a well thought-out, step-by-step manner. The end result is an answer worthy of being placed in a beginner level Python book as a chapter on decorators! So there must be other answers as awesome as this one, given by users as knowledgable as e-satis! I set out to find few more great StackOverflow threads on core Python programming, had them bookmarked for future reads, and now sharing them on this blog post. You should read each of them at least once to make your knowledge on core Python more solid.

Understanding Python decorators

As I mentioned above, great introduction to decorators in Python.

What is a meta-class in Python

Another great answer from e-satis (later turned into a community wiki). Explains what meta-classes are in Python and why are they so useful.

How to sort a list of objects in Python, based on an attribute of the objects?

The answer to this question often comes in handy!

Understanding Python super() and init methods

A short yet useful answer explaining what good is super() for. You should also read the article Pythons’s super() considered super! along with this.

What is the relationship between __getattr__ and getattr?

I always wondered; and Kimvais provided the answer! Also checkout Alex’s answer in the same thread.

The Python yield keyword explained

Another gem from e-satis. Introduced the concept of iterators and generators in Python and goes on to explain the use of yield statement.

Single quotes vs. double quotes in Python

The stylistic reasons for choosing double quotes or single quotes when coding in Python. Worth a read.

Python Compilation/Interpretation process

Very detailed answer explaining Python compilation/interpretation process to programmers not coming comp-sci background; something every Pythonist should know.

Python progression path- from apprentice to guru

Last but not the least! A great thread showing what road a Python beginner should take to achieve mastery.

If you know about any other great StackOverflow posts, please do share them on the comment section. I’ll update my list. The posts must be about Python (core Python more specifically).

About these ads

5 thoughts on “Learn core Python from Stackoverflow

  1. Pretty nice post. I just stumbled upon your weblog and wished to say that I’ve really enjoyed browsing your blog posts.
    After all I’ll be subscribing to your rss feed and I hope you write again soon!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s