Jun 27, 2012

apachetop

sudo apachetop -f logs/apache_access.log

Install multiple Python versions locally

https://github.com/utahta/pythonbrew - Pythonbrew is a program to automate the building and installation of Python in the users $HOME.
https://github.com/akheron/multipy - Install multiple Python versions locally

Jun 26, 2012

Stackless

Stackless Python is an enhanced version of the Python programming language. It allows programmers to reap the benefits of thread-based programming without the performance and complexity problems associated with conventional threads. The microthreads that Stackless adds to Python are a cheap and lightweight convenience which can if used properly, give the following benefits:
  • Improved program structure.
  • More readable code.
  • Increased programmer productivity.

Jun 21, 2012

Data Structures

weakref - module allows the Python programmer to create weak references to objects

Jun 20, 2012

Multiple Inheritance Best Practices

Multiple inheritance should be avoided: It can be replaced with some
design patterns.
  • super usage has to be consistent: In a class hierarchy, super should be used everywhere or nowhere. Mixing super and classic calls is a confusing practice. People tend to avoid super, for their code to be more explicit.
  • Don't mix old-style and new-style classes: Having a code base with both results in a varying MRO behavior.
  • Class hierarchy has to be looked over when a parent class is called: To avoid any problems, every time a parent class is called, a quick glance at the involved MRO (with __mro__) has to be done.

The common patterns for decorators are:

  • Argument checking 
  • Caching 
  • Proxy 
  • Context provider

Coroutines

http://pypi.python.org/pypi/greenlet
http://pypi.python.org/pypi/multitask